[Newbies] Detecting keyboard state / finding older fixes

stan shepherd squeak414 at free.fr
Tue Mar 4 18:19:54 UTC 2008


Thanks Herbert.

Unfortunately these methods seem to be 'fooled' by the operating system as
well.

for example:

handleKeyUp: anEvent 
	Transcript show: ' evt is down ',anEvent isKeyDown asString; cr.
        "now press and hold a key"

shows

 evt is down false
 evt is down false
 evt is down false
 evt is down false
 evt is down false
 evt is down false
 evt is down false
 evt is down false - while the key is clearly down.

I suppose this is logical, as the event is being triggered by the OS. Our
test needs to give the 'real' position of the key.

On Linux you can switch off the auto repeat in keyboard settings, but it's
not very friendly for other programs like text editing.

...Stan




Herbert König wrote:
> 
> Hello Stan,
> 
> I forgot:
> 
> sff>> operating system. I'd like to check the real position of a key, up
> or down, so I
> sff>> can ignore the repeats. I can't find any way to do this.
> 
> HK> Keyboard event understands #isKeyDown and #isKeyUp.
> 
> and don't forget to check the event's timestamp. Never did this myself
> but you can not rely on the fact that you will receive keyDown before
> keyUp.
> 
> 
> 
> Cheers
> 
> Herbert                            mailto:herbertkoenig at gmx.net
> 
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 
> 

-- 
View this message in context: http://www.nabble.com/Detecting-keyboard-state---finding-older-fixes-tp15779144p15833752.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.



More information about the Beginners mailing list