示例#1
0
文件: KeyMap.cs 项目: nzysoft/Eto
        public static swi.ModifierKeys ConvertModifier(Keys key)
        {
            key &= Keys.ModifierMask;
            swi.ModifierKeys val = swi.ModifierKeys.None;

            if (key.HasFlag(Keys.Alt))
            {
                val |= swi.ModifierKeys.Alt;
            }
            if (key.HasFlag(Keys.Control))
            {
                val |= swi.ModifierKeys.Control;
            }
            if (key.HasFlag(Keys.Shift))
            {
                val |= swi.ModifierKeys.Shift;
            }
            if (key.HasFlag(Keys.Application))
            {
                val |= swi.ModifierKeys.Windows;
            }
            return(val);
        }
示例#2
0
文件: KeyMap.cs 项目: nzysoft/Eto
        public static Keys Convert(swi.VirtualKey key, swi.ModifierKeys modifier)
        {
            Keys ret = Find(key);

            if (modifier.HasFlag(swi.ModifierKeys.Alt))
            {
                ret |= Keys.Alt;
            }
            if (modifier.HasFlag(swi.ModifierKeys.Control))
            {
                ret |= Keys.Control;
            }
            if (modifier.HasFlag(swi.ModifierKeys.Shift))
            {
                ret |= Keys.Shift;
            }
            if (modifier.HasFlag(swi.ModifierKeys.Windows))
            {
                ret |= Keys.Application;
            }

            return(ret);
        }