internal void OnInputDetected(FFEventParameter args) { FFEngine.Events.UnregisterForEvent("InputKeyDetected", OnInputDetected); isRegistered = false; InputKeyBinding newBinding = args.data as InputKeyBinding; if(newBinding.key != KeyCode.Escape) { EInputTriggerType type = binding.trigger; binding = newBinding; binding.trigger = type; } UpdateDisplay(); }
internal void OnInputDetected(FFEventParameter args) { FFEngine.Events.UnregisterForEvent("InputKeyDetected", OnInputDetected); isRegistered = false; InputKeyBinding newBinding = args.data as InputKeyBinding; if (newBinding.key != KeyCode.Escape) { EInputTriggerType type = binding.trigger; binding = newBinding; binding.trigger = type; _inputKey.UpdateBinding(binding); } UpdateDisplay(); }
internal void DoUpdate() { foreach (AInputEvent each in keys.Values) { each.DoUpdate(); } foreach (AInputAxis each in axis.Values) { each.DoUpdate(); } if (_isPollingKey) { InputKeyBinding binding = InputKeyBinding.Current; if (binding != null) { FFEventParameter args = new FFEventParameter(); args.data = binding; FFEngine.Events.FireEvent("InputKeyDetected", args); _isPollingKey = false; } } if (_isPollingAxis) { if (InputKeyBinding.IsEscapePressed()) { FFEngine.Events.FireEvent("InputAxisDetected", null); } else { InputControllerAxisBinding binding = InputControllerAxisBinding.Current; if (binding != null) { FFEventParameter args = new FFEventParameter(); args.data = binding; FFEngine.Events.FireEvent("InputAxisDetected", args); _isPollingAxis = false; } } } }
internal void UpdateBinding(InputKeyBinding a_newBinding) { _binding = a_newBinding; }
internal InputEventKey(string a_eventKeyName, InputKeyBinding a_binding) : base(a_eventKeyName) { _binding = a_binding; }
internal InputEventKey(EInputEventKey a_eventKey, InputKeyBinding a_binding) : this(a_eventKey.ToString(), a_binding) { }
internal InputEventKey(EInputEventKey a_eventKey, InputKeyBinding a_binding) : this(a_eventKey.ToString(),a_binding) { }