{"id":98695,"date":"2018-05-07T07:00:00","date_gmt":"2018-05-07T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=98695"},"modified":"2019-03-13T00:43:37","modified_gmt":"2019-03-13T07:43:37","slug":"20180507-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180507-00\/?p=98695","title":{"rendered":"After all, it&#8217;s called a hotkey, not a hotcharacter"},"content":{"rendered":"<p>A customer was writing a remote access program, and they were having trouble injecting hotkeys into the system. <\/p>\n<blockquote CLASS=\"q\">\n<p>We are sending the modified key as a scan code, and the base character as a Unicode character. We find that shortcuts of the form Modifier+Letter, such as <kbd>Ctrl<\/kbd>+<kbd>A<\/kbd>, are not working. Are there known limitations for keyboard shortcuts sent as a scancode+Unicode character? <\/p>\n<p>We are sending the base character as a Unicode character to avoid issues with localization and keyboard layouts. <\/p>\n<\/blockquote>\n<p>Keyboard shortcuts are based on virtual key codes, not Unicode characters. After all, it&#8217;s called a hotkey, not a hotcharacter. <\/p>\n<p>Continuing the above example, the <kbd>Ctrl<\/kbd>+<kbd>A<\/kbd> hotkey is not a <kbd>Ctrl<\/kbd> plus the Unicode character U+0041 (LATIN CAPITAL LETTER A). <\/p>\n<p>You cannot hold the <kbd>Ctrl<\/kbd> key while typing <kbd>Alt<\/kbd>+<kbd>0<\/kbd> <kbd>Alt<\/kbd>+<kbd>6<\/kbd> <kbd>Alt<\/kbd>+<kbd>5<\/kbd> on the numeric keypad to get a <kbd>Ctrl<\/kbd>+<kbd>A<\/kbd>. <\/p>\n<p>Even if CapsLock is off, you don&#8217;t have to hold the shift key to get a capital A. <\/p>\n<p>For the hotkey <kbd>Win<\/kbd>+<kbd>1<\/kbd>, you have to press the <kbd>1<\/kbd> on the main keyboard, not on the numeric keypad, even if NumLock is on. <\/p>\n<p>Keyboard hotkeys consist of the applicable modifiers, combined with the key on the keyboard that has the appropriate symbol printed on it. Sending a Unicode character isn&#8217;t the same as simulating a press of a key on a keyboard. <\/p>\n<p>You have to send the virtual key to complete the hotkey sequence. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hotkeys are based on keys.<\/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-98695","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Hotkeys are based on keys.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98695","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=98695"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/98695\/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=98695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=98695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=98695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}