Example #1
0
 public Button(ConsoleKey key_,bool alt,bool ctrl,bool shift,int row,int col,int height,int width)
 {
     key = key_;
     mods = (ConsoleModifiers)0;
     if(alt){
         mods |= ConsoleModifiers.Alt;
     }
     if(ctrl){
         mods |= ConsoleModifiers.Control;
     }
     if(shift){
         mods |= ConsoleModifiers.Shift;
     }
     rect = new Rectangle(col,row,width,height);
 }
Example #2
0
 public Button(ConsoleKey key_, bool alt, bool ctrl, bool shift, int row, int col, int height, int width)
 {
     key  = key_;
     mods = (ConsoleModifiers)0;
     if (alt)
     {
         mods |= ConsoleModifiers.Alt;
     }
     if (ctrl)
     {
         mods |= ConsoleModifiers.Control;
     }
     if (shift)
     {
         mods |= ConsoleModifiers.Shift;
     }
     rect = new Rectangle(col, row, width, height);
 }
 private bool ModifierHeld(ConsoleModifiers mod)
 {
     switch(mod){
     case ConsoleModifiers.Alt:
     return KeyIsDown(Key.LAlt) || KeyIsDown(Key.RAlt);
     case ConsoleModifiers.Control:
     return KeyIsDown(Key.LControl) || KeyIsDown(Key.RControl);
     case ConsoleModifiers.Shift:
     return KeyIsDown(Key.LShift) || KeyIsDown(Key.RShift);
     default:
     return false;
     }
 }