I am attempting to modify the controller file highway_overtake.py in order to access keyboard inputs from the user. After following the documentation, the relevant code appears as follows:
from Controller import Keyboard
keyboard = Keyboard();
keyboard.enable(50);
....
[other webots controller logic]
while driver.step () != -1
key = keyboard.getKey( )
if(key ==Keyboard.CONTROL+ord('M')):
print 'Key Pressed'
I believe this is following the documentation verbatim, and have tried modifying the example with various different key inputs. How should I proceed?
Referenced Documentation: https://www.cyberbotics.com/doc/reference/keyboard