コード例 #1
0
 private void Block_Enter(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         e.Handled = true;
         Logic.PerformClick(equals);
     }
 }
コード例 #2
0
 private void Error()
 {
     if (error == true)
     {
         Logic.PerformClick(clearall);
         error = false;
         last  = "";
     }
 }
コード例 #3
0
 private void Window_KeyDown(object sender, KeyEventArgs e)
 {
     if (!(Keyboard.IsKeyDown(Key.RightShift) || Keyboard.IsKeyDown(Key.LeftShift)))
     {
         if (e.Key == Key.D1 || e.Key == Key.NumPad1)
         {
             Logic.PerformClick(one);
         }
         else if (e.Key == Key.D2 || e.Key == Key.NumPad2)
         {
             Logic.PerformClick(two);
         }
         else if (e.Key == Key.D3 || e.Key == Key.NumPad3)
         {
             Logic.PerformClick(three);
         }
         else if (e.Key == Key.D4 || e.Key == Key.NumPad4)
         {
             Logic.PerformClick(four);
         }
         else if (e.Key == Key.D5 || e.Key == Key.NumPad5)
         {
             Logic.PerformClick(five);
         }
         else if (e.Key == Key.D6 || e.Key == Key.NumPad6)
         {
             Logic.PerformClick(six);
         }
         else if (e.Key == Key.D7 || e.Key == Key.NumPad7)
         {
             Logic.PerformClick(seven);
         }
         else if (e.Key == Key.D8 || e.Key == Key.NumPad8)
         {
             Logic.PerformClick(eight);
         }
         else if (e.Key == Key.D9 || e.Key == Key.NumPad9)
         {
             Logic.PerformClick(nine);
         }
         else if (e.Key == Key.D0 || e.Key == Key.NumPad0)
         {
             Logic.PerformClick(zero);
         }
         else if (e.Key == Key.Back)
         {
             Logic.PerformClick(backspace);
         }
         else if (e.Key == Key.OemComma || e.Key == Key.OemPeriod)
         {
             Logic.PerformClick(point);
         }
         else if (e.Key == Key.OemMinus)
         {
             Logic.PerformClick(minus);
         }
         else if (e.Key == Key.Enter || e.Key == Key.OemPlus)
         {
             Logic.PerformClick(equals);
         }
         else if (e.Key == Key.OemQuestion)
         {
             Logic.PerformClick(divide);
         }
         else if (e.Key == Key.Multiply)
         {
             Logic.PerformClick(multiply);
         }
     }
     else
     {
         if (e.Key == Key.OemPlus)
         {
             Logic.PerformClick(add);
         }
         else if (e.Key == Key.D8)
         {
             Logic.PerformClick(multiply);
         }
     }
 }