Skip to content

Can't register shortcut for non-English active keyboard on Windows #17

Closed
@semanser

Description

@semanser

Hi. Looks like current implementation does not support different keyboard languages.

For example if I register shortcut with English keyboard, everything working good (even after language change). But when I register shortcut with non-English active keyboard (Ukrainian for example), shortcut doesn't get registered.

After some debug, I found that the reason of the problem is in the VkKeyScan function:

if(keycode <= 0xFFFF) {//Try to obtain the key from it's "character"
const SHORT vKey = VkKeyScanW(keycode);
if(vKey > -1)
return LOBYTE(vKey);
}

This function always return -1 if current active keyboard is non-English.

As documentation said:

Translates a character to the corresponding virtual-key code and shift state for the current keyboard.

If the function finds no key that translates to the passed character code, both the low-order and high-order bytes contain –1.

So this function is dependends on the current active keyboard and should be replaced with to something else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy