Exemplo n.º 1
0
 static void OnKey(SFMLDevice Dev, KeyEventArgs E, bool Down)
 {
     if (E.Code == Keyboard.Key.LShift || E.Code == Keyboard.Key.RShift)
     {
         Dev.OnKey(NkKeys.Shift, Down);
     }
     else if (E.Code == Keyboard.Key.LControl || E.Code == Keyboard.Key.RControl)
     {
         Dev.OnKey(NkKeys.Ctrl, Down);
     }
     else if (E.Code == Keyboard.Key.Delete)
     {
         Dev.OnKey(NkKeys.Del, Down);
     }
     else if (E.Code == Keyboard.Key.Return)
     {
         Dev.OnKey(NkKeys.Enter, Down);
     }
     else if (E.Code == Keyboard.Key.Tab)
     {
         Dev.OnKey(NkKeys.Tab, Down);
     }
     else if (E.Code == Keyboard.Key.BackSpace)
     {
         Dev.OnKey(NkKeys.Backspace, Down);
     }
     else if (E.Code == Keyboard.Key.Up)
     {
         Dev.OnKey(NkKeys.Up, Down);
     }
     else if (E.Code == Keyboard.Key.Down)
     {
         Dev.OnKey(NkKeys.Down, Down);
     }
     else if (E.Code == Keyboard.Key.Left)
     {
         Dev.OnKey(NkKeys.Left, Down);
     }
     else if (E.Code == Keyboard.Key.Right)
     {
         Dev.OnKey(NkKeys.Right, Down);
     }
     else if (E.Code == Keyboard.Key.Home)
     {
         Dev.OnKey(NkKeys.ScrollStart, Down);
     }
     else if (E.Code == Keyboard.Key.End)
     {
         Dev.OnKey(NkKeys.ScrollEnd, Down);
     }
     else if (E.Code == Keyboard.Key.PageDown)
     {
         Dev.OnKey(NkKeys.ScrollDown, Down);
     }
     else if (E.Code == Keyboard.Key.PageUp)
     {
         Dev.OnKey(NkKeys.ScrollUp, Down);
     }
 }
Exemplo n.º 2
0
 static void OnKey(SFMLDevice Dev, KeyEventArgs E, bool Down)
 {
     if (E.Code == Keyboard.Key.LShift || E.Code == Keyboard.Key.RShift)
     {
         Dev.OnKey(nk_keys.NK_KEY_SHIFT, Down);
     }
     else if (E.Code == Keyboard.Key.LControl || E.Code == Keyboard.Key.RControl)
     {
         Dev.OnKey(nk_keys.NK_KEY_CTRL, Down);
     }
     else if (E.Code == Keyboard.Key.Delete)
     {
         Dev.OnKey(nk_keys.NK_KEY_DEL, Down);
     }
     else if (E.Code == Keyboard.Key.Return)
     {
         Dev.OnKey(nk_keys.NK_KEY_ENTER, Down);
     }
     else if (E.Code == Keyboard.Key.Tab)
     {
         Dev.OnKey(nk_keys.NK_KEY_TAB, Down);
     }
     else if (E.Code == Keyboard.Key.BackSpace)
     {
         Dev.OnKey(nk_keys.NK_KEY_BACKSPACE, Down);
     }
     else if (E.Code == Keyboard.Key.Up)
     {
         Dev.OnKey(nk_keys.NK_KEY_UP, Down);
     }
     else if (E.Code == Keyboard.Key.Down)
     {
         Dev.OnKey(nk_keys.NK_KEY_DOWN, Down);
     }
     else if (E.Code == Keyboard.Key.Left)
     {
         Dev.OnKey(nk_keys.NK_KEY_LEFT, Down);
     }
     else if (E.Code == Keyboard.Key.Right)
     {
         Dev.OnKey(nk_keys.NK_KEY_RIGHT, Down);
     }
     else if (E.Code == Keyboard.Key.Home)
     {
         Dev.OnKey(nk_keys.NK_KEY_SCROLL_START, Down);
     }
     else if (E.Code == Keyboard.Key.End)
     {
         Dev.OnKey(nk_keys.NK_KEY_SCROLL_END, Down);
     }
     else if (E.Code == Keyboard.Key.PageDown)
     {
         Dev.OnKey(nk_keys.NK_KEY_SCROLL_DOWN, Down);
     }
     else if (E.Code == Keyboard.Key.PageUp)
     {
         Dev.OnKey(nk_keys.NK_KEY_SCROLL_UP, Down);
     }
 }