protected virtual void UpdateKeyboardState(InputState state) { if (PassThrough) { return; } KeyboardState keyboard = (KeyboardState)state.Keyboard; List <Key> keys = new List <Key>(); foreach (InputHandler h in inputHandlers) { if (!h.IsActive) { continue; } IKeyboardInputHandler kh = h as IKeyboardInputHandler; if (kh == null) { continue; } h.UpdateInput(currentCursorHandler == h); keys.AddRange(kh.PressedKeys); } keyboard.Keys = new List <Key>(keys); }
public KeyboardInputRemapper(IKeyboardInputHandler keyboardInputHandler) { this.privateKeyboardInputHandler = keyboardInputHandler; // store default keyMapping['E'] = EnumRemappedKey.ENTITY_ACCELERATE; keyMapping['C'] = EnumRemappedKey.ENTITY_DEACCELERATE; keyMapping['A'] = EnumRemappedKey.ENTITY_YAWADD; keyMapping['D'] = EnumRemappedKey.ENTITY_YAWSUB; keyMapping['W'] = EnumRemappedKey.ENTITY_PITCHADD; keyMapping['S'] = EnumRemappedKey.ENTITY_PITCHSUB; }