InputSensor - Keyboard State?

David N. Smith (IBM) dnsmith at watson.ibm.com
Mon Feb 5 23:01:55 UTC 2001


Ali:

All mouseMove events are inferred in Squeak rather than being taken from the system event queue. If they were taken from the system then button status is presumably present. If the Mac event loop detected mouseMove events then it could record the button status for grabbing by Sensor for the next mouseMove event. (Presumably this would eliminate the need to zero out the button status field too, thus allowing Sensor to work more as expected. I don't know what the performance penalty would be.

All I want to do is see if the shift key is down when the mouse moves and I can't do it. I can detect mouse moves and set the color of a morph when the mouse pointer moves over it, but I cannot see the shift key to see which color to change it to. (This makes sense in the context of its application.)

Maybe this is something that can go in the new Mac VM. I hope that it is portable in that something similar can be done on other platforms.

Dave


At 16:48 +1100 2/1/01, Ali Chamas wrote:
>Hi Friends,
>
>    Curiously, why is it so hard to implement key down/up state checking?
>When you ask for a key from the InputSensor, it flushes the buffer. Isn't it
>easy to peek on the state of a key without flushing the other input too? You
>can do it in C, and that's what's used to write the Squeak plug-ins. I
>remember some discussion a while back, and i am needing to implement this
>behavior in a Squeak app i am writing, and i can't (or can i?).
>
>Thanks in advance,
>Squeak is awesome.
>
>Ali.
-- 
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author  
and not of his employer.





More information about the Squeak-dev mailing list