|
|
|
|
|
by eviks
755 days ago
|
|
This rigid simplistic attitude is precisely why we can't have nice keyboard things and have been stuck in the same state of bad defaults for decades The only differentiator for a modifier state is that it... modifies! Here is a wiki common sense definition > In computing, a modifier key is a special key (or combination) on a computer keyboard that temporarily modifies the normal action of another key when pressed together So your limitations don't make conceptual sense, not only can you have LShift vs RShift modifier state, but also you can have an F modifier state when you hold down the F key to modify the behavior of other keys > OS does not supply it Unless it does? > VK_LSHIFT VK_RSHIFT VK_LCONTROL VK_RCONTROL VK_LMENU VK_RMENU These left- and right-distinguishing constants are available to an application only through the GetKeyboardState, SetKeyboardState, GetAsyncKeyState, GetKeyState, and MapVirtualKey functions. https://learn.microsoft.com/en-us/windows/win32/api/winuser/... |
|
And lets apply some common sense to your common sense, follow up on it a little. If a modifier is defined by the fact that it modifies the actions of other keys, then left and right modifer keys modify the action in exactly the same way and thus are the same modifier. Common sense indeed.
And if you want to reference windows, a platform kitty does not support, here you go: https://developer.apple.com/documentation/appkit/nseventmodi...
no left and right modifier state on macOS. And neither does X11/Wayland have them, though I dont have a link handy, so I will just leave you with a couple of links to the documentation for cross platform toolkits instead:
https://doc.qt.io/qt-6/qt.html#KeyboardModifier-enum https://www.glfw.org/docs/latest/group__mods.html
And in case the common sense didnt make it past your mental barriers, a terminal keyboard protocol has to work on all platforms not just windows. The good lord alone knows what windows does, probably synthesizes that state based on press and release events.