def createInputMapping(): from client import show_context_menu, mouse_action, reset_mouse_action # create an io map ioMap = OpenNero.PyIOMap() # bind our keys ioMap.ClearMappings() ioMap.BindKey("KEY_ESCAPE", "onPress", switchToHub) ioMap.BindKey("KEY_F1", "onPress", common.openWiki('NeroMod')) ioMap.BindKey("KEY_F2", "onPress", toggleDisplayHint) ioMap.BindMouseAction("moveX", mouse_action) ioMap.BindMouseAction("moveY", mouse_action) ioMap.BindMouseButton("left", "onPress", reset_mouse_action) ioMap.BindMouseButton("right", "onRelease", blank) ioMap.BindMouseButton("middle", "onPress", blank) ioMap.BindMouseButton("middle", "onRelease", blank) ioMap.BindMouseButton("right", "onPress", show_context_menu) ioMap.BindMouseButton("right", "onRelease", blank) ioMap.BindMouseAction("scroll", blank) # FPS control ioMap.BindKey("KEY_KEY_A", "onPress", first_person_control('CCW')) ioMap.BindKey("KEY_KEY_D", "onPress", first_person_control('CW')) ioMap.BindKey("KEY_KEY_W", "onPress", first_person_control('FWD')) ioMap.BindKey("KEY_KEY_S", "onPress", first_person_control('BCK')) ioMap.BindKey("KEY_LEFT", "onPress", first_person_control('CCW')) ioMap.BindKey("KEY_RIGHT", "onPress", first_person_control('CW')) ioMap.BindKey("KEY_UP", "onPress", first_person_control('FWD')) ioMap.BindKey("KEY_DOWN", "onPress", first_person_control('BCK')) return ioMap
def createInputMapping(): from client import show_context_menu, mouse_action, reset_mouse_action # create an io map ioMap = OpenNero.PyIOMap() # bind our keys ioMap.ClearMappings() ioMap.BindKey("KEY_ESCAPE", "onPress", switchToHub) ioMap.BindKey("KEY_F1", "onPress", common.openWiki('NeroMod')) ioMap.BindKey("KEY_F2", "onPress", showDisplayHint) # Keyboard control ioMap.BindKey("KEY_RIGHT", "onHold", lambda: key('right')) ioMap.BindKey("KEY_LEFT", "onHold", lambda: key('left')) ioMap.BindKey("KEY_UP", "onHold", lambda: key('fwd')) ioMap.BindKey("KEY_DOWN", "onHold", lambda: lambda: key('back')) ioMap.BindMouseAction("moveX", mouse_action) ioMap.BindMouseAction("moveY", mouse_action) ioMap.BindMouseButton("left", "onPress", reset_mouse_action) ioMap.BindMouseButton("left", "onRelease", blank) ioMap.BindMouseButton("middle", "onPress", blank) ioMap.BindMouseButton("middle", "onRelease", blank) ioMap.BindMouseButton("right", "onPress", show_context_menu) ioMap.BindMouseButton("right", "onRelease", blank) ioMap.BindMouseAction("scroll", blank) return ioMap