darcs patch: Make prompt keybindings work when numLock or capsLock are active

I don't see a reason not to ignore numLock and capsLock and the like when a prompt is open. _____ Justin Bogner

On Sun, Jun 08, 2008 at 11:26:14AM -0600, Justin Bogner wrote:
I don't see a reason not to ignore numLock and capsLock and the like when a prompt is open.
Applied, with two suggestions: 1. Use Data.Bits.testBit. 2. Don't ignore shift or mod1-5? (Actually, I suppose those two are mutually exclusive.. I'd imagine the code to the last one looking like: mask .&. (foldl' (.|.) [controlMask, mod1Mask, ...]) == controlMask unless there's a cleverer way.)

Devin Mullins wrote:
On Sun, Jun 08, 2008 at 11:26:14AM -0600, Justin Bogner wrote:
I don't see a reason not to ignore numLock and capsLock and the like when a prompt is open.
Applied, with two suggestions: 1. Use Data.Bits.testBit. 2. Don't ignore shift or mod1-5?
(Actually, I suppose those two are mutually exclusive.. I'd imagine the code to the last one looking like: mask .&. (foldl' (.|.) [controlMask, mod1Mask, ...]) == controlMask unless there's a cleverer way.)
I like your first suggestion, since I didn't like comparing to zero (though checking if it was still controlMask would be more correct logic than what I have now, anyway). As for the second suggestion, I sort of like it and sort of don't. Is there a good reason to not ignore shift? I most certainly want to ignore numlock, but I can't purely determine what that is, and I don't think there's a particularly good reason not to ignore the others. ______ Justin Bogner

Looking at it further, using testBit is actually much uglier. I'd have to do something like
lg x = log x / log 2 testBit mask (lg controlMask) since controlMask isn't defined as "which bit is set", but as an actual bitmask. The attached patch is semantically equivalent to my previous one but would still work properly if controlMask was more than a single bit (which it isn't, of course, but the logic seems cleaner this way)
Justin Bogner

Oops, hadn't realized it was actually applied, disregard my more recent patch, it will conflict. _____ Justin Bogner

On Sun, Jun 08, 2008 at 04:37:41PM -0600, Justin Bogner wrote:
Looking at it further, using testBit is actually much uglier. I'd have to do something like
lg x = log x / log 2 testBit mask (lg controlMask) Oh, indeed. My mistake.
My thought behind the shift thing was to make room for a future keybinding involving shift, but it had a question mark on it, so whatev'.
participants (2)
-
Devin Mullins
-
Justin Bogner