Пример #1
0
        public bool equals(Object value)
        {
            if (value == null)
            {
                return(false);
            }
            if (!(value is KeyStroke))
            {
                return(false);
            }
            KeyStroke stroke = (KeyStroke)value;

            return(this.keys == stroke.keys);
        }
Пример #2
0
 public static KeyStroke getKeyStroke( int keyCode, int modifiers )
 {
     KeyStroke ret = new KeyStroke();
     if ( (InputEvent.ALT_MASK & modifiers) == InputEvent.ALT_MASK ) {
         ret.keys = ret.keys | System.Windows.Forms.Keys.Alt;
     }
     if ( (InputEvent.CTRL_MASK & modifiers) == InputEvent.CTRL_MASK ) {
         ret.keys = ret.keys | System.Windows.Forms.Keys.Control;
     }
     if ( (InputEvent.SHIFT_MASK & modifiers) == InputEvent.SHIFT_MASK ) {
         ret.keys = ret.keys | System.Windows.Forms.Keys.Shift;
     }
     System.Windows.Forms.Keys key = (System.Windows.Forms.Keys)keyCode;
     ret.keys = ret.keys | key;
     return ret;
 }
Пример #3
0
        public static KeyStroke getKeyStroke(int keyCode, int modifiers)
        {
            KeyStroke ret = new KeyStroke();

            if ((InputEvent.ALT_MASK & modifiers) == InputEvent.ALT_MASK)
            {
                ret.keys = ret.keys | System.Windows.Forms.Keys.Alt;
            }
            if ((InputEvent.CTRL_MASK & modifiers) == InputEvent.CTRL_MASK)
            {
                ret.keys = ret.keys | System.Windows.Forms.Keys.Control;
            }
            if ((InputEvent.SHIFT_MASK & modifiers) == InputEvent.SHIFT_MASK)
            {
                ret.keys = ret.keys | System.Windows.Forms.Keys.Shift;
            }
            System.Windows.Forms.Keys key = (System.Windows.Forms.Keys)keyCode;
            ret.keys = ret.keys | key;
            return(ret);
        }