Dave Williss wrote:
----- Original Message ----- From: "Michel Bardiaux" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 29, 2004 3:37 AM
Subject: Re: [Lesstif-discuss] Controversial (?) fix for accelerators
Danny Backx wrote:
Dave Williss sent me a fix with this comment :
Controversial hack to accept accelerators even if NumLock and/or CapsLock is on. It's up to you whether you want to accept this or maybe come up with a better way.
I've put it in for review; I'd like input on whether we want this in, out, or conditionally compiled or so.
Danny
I have already written about that, but since a review is begun I'll repeat it: by my experience OSF-Motif and its kin (that I have used: Motif on SGI IRIX, and OpenMotif on Linux) do *not* have this feature; I mean, they do *not* recognize accelerators when Lock is on; and Lesstif should avoid behavioral incompatibilities.
I thought that OSF Motif 1.2 _did_ have this feature, but I just proved myself wrong. People only started complaining about it when we changed to Lesstif because at the same time we changed the accelerators for Cut/Copy/Paste in our software to the Ctrl-X/Ctrl-C/Ctrl-V that everybody expects so they just started using them. Before they were Shift+Del, Ctrl+Ins, and Shift+Ins which nobody used and therefore didn't notice the problem.
OK, given that, I'd call this a bug in Motif, and Lesstif just faithfully reproduces the same bug. The reason I'd consider it a bug is that the resource file has...
*copy.accelerator: Ctrl<Key>c
Which follows the Xt syntax for translations. According to Appendix F of the X Toolkit Intrinsics Reference Manual....
* If an exclamation point (!) is specified at the beginning of the modifier list, it means that the listed modifiers must be in the correct state and no other modifiers can be asserted. * If any modifiers are specified and an exclamation point (!) is not specified, it means that the listed modifiers must be in the correct state and "don't care" about any other modifiers.
I have no bang, therefore other modifiers should be ignored.
I agree. Besides, it makes software *more* difficult to use: when in CAPLOCKS (which is useful if you have to enter text in all caps because of some business rule), you have to use... Ctrl+Shift+c - or maybe that does not work... and since *that* is not obvious, the bug also violates the 'principle of least astonishment'.
The problem can and should be fixed at application level, or in a utility library. I am willing to donate the code I have e.g. to Xlt (it *does* build for OpenMotif, right?). This way there would be a solution without breaking compatibility (Well, compatibility is already broken, but development of Lesstif should aim at convergence rather than add more divergence).
Given that the goal of Lesstif is compatability with Motif, even if the
later is wrong, I guess this should be fixed at the application level.
So far, 2 against 0...
The idea is to scan recursively the whole widget tree, and for each accelerator, add translations for all combinations of the modifiers one wants to ignore, e.g., "Alt<Key>P" bySo how does one do this?
"Alt<Key>P,Lock Alt<Key>P,Mod3 Alt<Key>P,Lock Mod3 Alt<Key>P"
BTW by my reading of that Intrinsics Ref Man, there is *no* name for numlock, one has to find the corresponding Mod# using xmodmap or equivalent thereof. Am I correct?
HaND, -- Michel Bardiaux Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles Tel : +32 2 790.29.41
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Lesstif-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/lesstif-discuss

