{"id":97295,"date":"2017-10-26T07:00:00","date_gmt":"2017-10-26T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=97295"},"modified":"2019-03-13T01:19:28","modified_gmt":"2019-03-13T08:19:28","slug":"20171026-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20171026-00\/?p=97295","title":{"rendered":"How do I prevent my registered hotkey from firing repeatedly due to auto-repeat?"},"content":{"rendered":"<p>You can register a global hotkey with the <code>Register&shy;Hot&shy;Key<\/code> function, but one problem many people have is that if the user presses and holds the hotkey sequence, the hotkey will be invoked as fast as auto-repeat will let it. For some types of hotkeys, this is not desirable. How do you prevent this? <\/p>\n<p>Starting in Windows 7, you can pass the <code>MOD_<\/code><code>NO&shy;REPEAT<\/code> flag to the <code>Register&shy;Hot&shy;Key<\/code> function to tell it not to generate <code>WM_<\/code><code>HOT&shy;KEY<\/code> messages if the hotkey activation sequences was triggered by autorepeat. <\/p>\n<p>The initial press of the hotkey will generate a <code>WM_<\/code><code>HOT&shy;KEY<\/code> message, but the auto-repeats will not. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can ask for auto-repeat to be ignored.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-97295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You can ask for auto-repeat to be ignored.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/97295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=97295"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/97295\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=97295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=97295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=97295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}