Пример #1
0
 public virtual void KeyReleased(LKey e)
 {
     if (isLock || isClose || !isLoad)
     {
         return;
     }
     int type = e.GetCode();
     int code = e.GetKeyCode();
     try
     {
         if (useScreenListener)
         {
             foreach (ScreenListener t in screens)
             {
                 t.Released(e);
             }
         }
         this.OnKeyUp(e);
         keyType[type] = false;
         keyButtonReleased = code;
         keyButtonPressed = NO_KEY;
     }
     catch (Exception ex)
     {
         keyButtonPressed = NO_KEY;
         keyButtonReleased = NO_KEY;
         Log.Exception(ex);
     }
 }
Пример #2
0
 public virtual void KeyPressed(LKey e)
 {
     if (isLock || isClose || !isLoad)
     {
         return;
     }
     int type = e.GetCode();
     int code = e.GetKeyCode();
     try
     {
         if (useKeyListener)
         {
             foreach (KeyListener t in keys)
             {
                 t.pressed(e);
             }
         }
         this.OnKeyDown(e);
         keyType[type] = true;
         keyButtonPressed = code;
         keyButtonReleased = NO_KEY;
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
         keyButtonPressed = NO_KEY;
         keyButtonReleased = NO_KEY;
     }
 }