This site requires JavaScript, please enable it in your browser!
Greenfoot back
KIITAKII
KIITAKII wrote ...

2023/7/7

Left and Right [Shift] keys

KIITAKII KIITAKII

2023/7/7

#
Hey, y'all. I was wondering if Greenfoot can detect whether or not the Left or Right shift key is down since there are two of them. I'm looking for a function that can detect that. Kinda like a " ...isKeyDown("lshift"));" type of thing. If there is, could you please tell me; and if there isn't, a simple "no" suffices. Thanks!
danpost danpost

2023/7/7

#
KIITAKII wrote...
I was wondering if Greenfoot can detect whether or not the Left or Right shift key is down since there are two of them. I'm looking for a function that can detect that. Kinda like a " ...isKeyDown("lshift"));" type of thing.
Unfortunately for you, there is no disambiguation between the two shift keys while using the isKeyDown method of the Greenfoot class. In fact, the java constants for the KeyEvent class do not distinguish between them (only has a constant for shift; no left shift or right shift constants).
KIITAKII KIITAKII

2023/7/7

#
Alright, thanks, danpost
You need to login to post a reply.