Re: Key-combination for zoom (forked from fltk-general Sys-Menu-Bar thread)
"'Albrecht Schlosser' via fltk.coredev"
Mar 06, 2024
On 3/5/24 21:50 Albrecht Schlosser wrote:
... for
non-letter keys like '+', '-', '=' I couldn't find a usable
value. It looks like CTRL / X where X is a key on the default (US)
keyboard layout. This doesn't really help. There are more
functions I
didn't explore (yet?) to map virtual keycodes to a specific key
dependent on the "keyboard layout". This *might* help if this
would give
us the information that (a) the CTRL key and (b) the '=' key was
pressed. The latter maybe derived from the scan code and the
current
keyboard layout...
If anybody could help by contributing code how to map a CTRL/K
combo
with 'K' not being an alphabetical key, then I'd appreciate this
very much!
I'm still looking for a clean and system conformant way to get the
correct key information. Any help would be appreciated.
However, I made progress: I found the culprit of the inconsistent
key codes on Windows!
The problem is that we don't get the key codes from Windows. We are
using a "hand-made" translation table in our code instead, and this
table is based in large parts on Windows' "virtual key codes" (for
all function keys, letter keys, etc.) which is good but there is
another much smaller part (11 non-letter key codes) that translates
key codes to key symbols like '+', '-', ';', etc. - and this
part of the table uses the US/UK keyboard layout unconditionally!
This is the reason why (some) ctrl/X combos (for X = non-letter
keys) worked, mainly on US/UK keyboards but not on other keyboards.
I'm trying to find a better solution but so far I don't know if I
can find a solution independent of hard-coded keyboard layout
information. That would be my goal. Although I'm much more confident
now. There *should* be a way to get the key
information from the OS...
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.