Right shift issues on mac?

Hello again, I need to check if the right shift key is currently active to change the result of another key press.

For regular keys I was using(example):

		#Keyboard possible inputs
		if self.keyboard.events[events.PKEY] == logic.KX_INPUT_JUST_ACTIVATED:

But when I try RIGHTSHIFTKEY or any other events modifier key nothing happens(I know it because as a test I used a python print).

So how can I achieve what I wanted above? I hope the BGE hasn’t issues with mac keyboards as it has with its mouse.

On my computer Windows XP 32 bit the RIGHTSHIFTKEY is working.


import bge
# Just shortening names here
keyboard = bge.logic.keyboard
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
#print (bge.events.RIGHTSHIFTKEY)
#print (keyboard.events)
if keyboard.events[bge.events.RIGHTSHIFTKEY] == JUST_ACTIVATED:
    print("Activate RIGHTSHIFTKEY!")

Print the keyboard.events and look if the value by the number 128 is changing.

Ok, I tried:

if self.keyboard.events[128] != 0: print('Shift key being pressed')

Nothing happens when I press the shift key, but if I change it to check for events 98, which is the B key, it does output the message when it is pressed.

Maybe it is an issues with mac keyboards.

No XD, don’t say that… I think I will make a bug report now

Try making a for statement that loops through the events of the keyboard and find which is active, but only activate the script via a keyboard sensor for the rshift key.

e.g


import bge

keyboard = bge.logic.keyboard.events
for event in keyboard:
    if event == 2 or event == 1:
        print(event)

I did:

for event in self.keyboard.events:
	if self.keyboard.events[event] != 0:
		print(event)

it printed 129! And if it detected that, then I can setup a provisory workaround for my game. But it recognizes the two keyboard shifts as one event(129), be it right shift or left shift.

Ah. That’s an issue

Another one to make company to the events.RIGHTSHIFTKEY issue in a mac keyboard