Recognizing that CTRL-SHIFT have come up together #1840
Replies: 4 comments
-
From @nbriggs: |
Beta Was this translation helpful? Give feedback.
-
From @rmkaplan: My current thought is that if both keys were down the last time around the polling loop, and now one of them is up but one is down, then wait a bit (50 msec?) and check again to see if they are now both up. So far seems to work. But I’m still open to better ideas. |
Beta Was this translation helpful? Give feedback.
-
From @rmkaplan: (LAMBDA (READONLY CUROPERATION)
|
Beta Was this translation helpful? Give feedback.
-
It might be helpful to make a state transition diagram and include the visual feedback as well as when effects actually happen. Here's a strawman for constraints:
|
Beta Was this translation helpful? Give feedback.
-
Original question from @rmkaplan:
I’m having trouble in Tedit in recognizing that the CTRL-SHIFT had been down when the user releases the keys. It’s in a polling loop decoding the key combinations into MOVE (both down), COPY (shift only), DELETE (CTRL only).
The problem (I think) is that the user doesn’t actually release the keys simultaneously, it goes around the loop between the time that one key has come up but the other hasn’t. So an intended MOVE gets seen as either a COPY or a DELETE. And if the mouse is also up at that time, the action is executed.
But that kind of transition is also generally allowed—you can change your mind in the middle, say by adding a CTRL to a SHIFT to go from a delete to a move or vice versa (as long as something stays down when you fiddle). And you can do this whether the mouse buttons are up or down, if you want to move to a new location with the same operation.
Is there an established way of recognizing CTRL-SHIFT coming up (or going down) as an atomic event? Putting in some sort of explicit timing delay before it goes around the loop again?
Beta Was this translation helpful? Give feedback.
All reactions