Greg Ercolano wrote: > Bill Spitzak wrote: >> Matthias Melcher wrote: >> >>> And it needs three characters to be encoded in utf8. The mentioned shortcut >>> modifiers function is a left-over from the Forms Library. I would not put >>> that much thought into it. Just choose something that is unlikely to be >>> used as a shortcut character (because once it is a modifier, it can't be a >>> character anymore, right?). How about the tilde ~ ?, or the vertical bar | ? >> Actually no problem with using a symbol somebody may have used as a >> shortcut. You can make "!A" mean command+A, while at the same time make >> just "!" mean "!". > > Right, so to get '!' as a literal shortcut, you'd maybe have the choice > of: > > AS INTEGER: > FL_SHIFT+'1' -- string equivalent would be: "+1" > '!' -- string equivalent would be: "!" > > AS STRING: > "!" -- integer equivalent would be: '!' > "+1" -- integer equivalent would be: FL_SHIFT+'1' > > And that seems that would be consistent with your previous post > where case doesn't matter when specifying shortcuts: > > 'a' -- unshifted 'a' (string equivalent "a" or "A") > 'A' -- unshifted 'a' (string equivalent "A" or "a") > FL_SHIFT+'a' -- shifted 'a' (string equivalent "+a") > FL_SHIFT+'A' -- shifted 'a' (string equivalent "+A")
Yes it seems some clean rules that work are, when comparing a shortcut: 1. Make sure all the requested shift keys are held down. 2. Make sure *some* of the not-requested shift keys (CTRL,ALT,META) are *not* held down. 3. Compare the lower-cased value against the event key. This will match the '1' and 'A' and 'a' in above examples. 4. If that does not work and the key produced one character of text, compare the text to the value. This will get the "!" in the above examples. There is lots of obsolete code to try to make it more lenient with matching, and to make capital A mean shift must be held down. I think this can and should be removed. Instead support for multiple shortcuts should be added (this was done in FLTK 2). One area this may fail is if you do FL_CTRL+'!'. This should mean hold down ctrl and type a '!' (which probably means also holding down shift and type a '1'). This works on my keyboard on Linux but I do not know about Windows or Mac (try the test/keyboard program). If in fact other platforms do not produce '!' when the extra keys are held down we may want to say this is undefined, or purposely disable it on Linux. > > I can go either way on the casing of the letters being relevant, > as long as the method chosen works consistently across all platforms. > >> Another possibility is to just make '^' mean command. It is the same as >> CTRL on Windows and Linux, right? > > Can we change the definition of "^" this late? > Historically, "^c" has always meant Ctrl-C on all platforms, including > macs, > IIRC. > > With new codes, "!c" could mean Command-C on macs, and Ctrl-C on > windows/linux. Yea I agree. Just make '!' mean FL_COMMAND and leave '^' as FL_CTRL. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
