Where I was confused is that checking if the key is pressed already doesn't
appear to differentiate between a 'real' key down and a repeat. For example
:
keyDown: anEvent
(keys includes: anEvent keyValue)
ifTrue: [Transcript show: 'skipped ' , anEvent asString; cr]
On Mar 7, 2008, at 14:54 , stan shepherd wrote:
Where I was confused is that checking if the key is pressed already
doesn't
appear to differentiate between a 'real' key down and a repeat. For
example
:
keyDown: anEvent
(keys includes: anEvent keyValue)
ifTrue:
I am indeed on Linux. I have a feeling that Windows was the same (coding in
Java). That is, in the programming language a real key down and a repeat are
indistinguishable.
Stan
Bert Freudenberg wrote:
On Mar 7, 2008, at 14:54 , stan shepherd wrote:
Where I was confused is that checking
On Mar 7, 2008, at 17:53 , stan shepherd wrote:
I am indeed on Linux. I have a feeling that Windows was the same
(coding in
Java).
I am pretty sure it works in the Windows VM. You should get multiple
keyDown events but a single keyUp:
Down ... (pause) ... down - down - down - down -
As I have dual boot Linux/Windows, I'll try and verify the Windows result in
the next day or two.
Bert Freudenberg wrote:
I am pretty sure it works in the Windows VM. You should get multiple
keyDown events but a single keyUp:
Down ... (pause) ... down - down - down - down - down -
Bert, Thanks for the reply and example.
To get around the repeat key issue, I'm testing the elapsed time since last
keystroke. If it's too short, assume it's repeat key from the OS:
keyDelay := (anEvent timeStamp) - (lastEventTime at: noteNo) .
lastEventTime at: noteNo put:
Assuming this is for a game, you would effectively prevent someone
hammering on a key to do some action repeatedly. Also this depends
on the actual repeat rate which varies widely between systems. In my
example there is no such fixed timeout, you simply would check if the
key is pressed
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
On Mar 4, 2008, at 19:19 , stan shepherd wrote:
handleKeyUp: anEvent
Transcript show: ' evt is down ',anEvent isKeyDown asString; cr.
now press and hold a key
shows
evt is down false
Which is of course expected since only keyUp events are passed into
#handleKeyUp:, so
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
Hello Stan,
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.
Keyboard event understands #isKeyDown and #isKeyUp.
Cheers
Herbertmailto:[EMAIL PROTECTED]
(resend, as previously not subscribed and message blocked waiting
approval)
I'm using my qwerty/azerty keyboard for input to a game. The issue is that when
you press and hold a key, you receive repeats of the key press from the
operating system. I'd like to check the real position of a key, up or
12 matches
Mail list logo