コード例 #1
0
 internal KeyEventArgs(SFMLKeyEventArgs args)
 {
     Key     = (Keyboard.Key)(int) args.Code;
     Alt     = args.Alt;
     Control = args.Control;
     Shift   = args.Shift;
     System  = args.System;
 }
コード例 #2
0
        internal void OnKeyReleased(object sender, SFMLKeyEventArgs e)
        {
            // Update button register
            _isKeyDown[(int)e.Code + 1] = false;

            // Convert event args
            KeyEventArgs args = new KeyEventArgs(e);

            // Call events next update
            _update += delegate
            {
                // Call game states events
                foreach (KeyboardBindingCollection c in _gameBindings.Values)
                {
                    c.OnReleased(args);
                }

                // Call direct bindings
                _bindings.OnReleased(args);
            };

            GameConsole.WriteLine(string.Format("InputKeyboard: Released {0}", e.Code)); // Debug
        }