checking the current state of a key (down or up)

6 views
Skip to first unread message

Christophe Pallier

unread,
Apr 20, 2021, 9:26:21 AM4/20/21
to expyriment-users
Hello,

The keyboard.check() and keyboard.wait() seems to treat the keydown event only once, and this does not allow to detect if the participants keeps pressing a key (+ autorepeat seems disabled).
Is there a way to monitor the state of a key? Or enable a sort of autorepeat (if a key is still pressed after a certain amount of time, another keydown event is emitted).

[The context: a situation is which you control a continuous parameter with ''-' and '+' keys.] 


Florian Krause

unread,
Apr 20, 2021, 10:36:06 AM4/20/21
to expyrime...@googlegroups.com
Hi Christophe,

it is technically possible by directly calling the corresponding Pygame function repeatedly: pygame.key.get_pressed()

This will bypass Excpyriment's logging though. We could think about implementing this directly in Expyriment though. I will put it on our feature request list.

Best,
Florian



--
You received this message because you are subscribed to the Google Groups "expyriment-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to expyriment-use...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/expyriment-users/89ee616e-a279-4623-a5e2-9a445849e582n%40googlegroups.com.


--
Florian Krause (Developer)
www.expyriment.org
Reply all
Reply to author
Forward
0 new messages