Example #1
0
 private void PressSomeKey(KeyCode keyCode)
 {
     if (keyCode == COMBINED_KEY_CODE)
     {
         if (combineKey)
         {
             return;
         }
         combineKey = true;
     }
     else
     {
         KeyCollection keyCollection = new KeyCollection();
         if (combineKey)
         {
             keyCollection.keyCodes.Add(COMBINED_KEY_CODE);
             keyCollection.keyCodes.Add(keyCode);
             SomeKeyPressd?.Invoke(keyCollection);
             combineKey = false;
         }
         else
         {
             keyCollection.keyCodes.Add(keyCode);
             SomeKeyPressd?.Invoke(keyCollection);
             combineKey = false;
         }
     }
 }
Example #2
0
 private void PressSomeKey(KeyCode keyCode)
 {
     if (keyCode == COMBINED_KEY_CODE)
     {
         if (combineKey)
         {
             return;
         }
         combineKey = true;
     }
     else
     {
         if (combineKey)
         {
             SomeKeyPressd?.Invoke(COMBINED_KEY_CODE | keyCode);
             combineKey = false;
         }
         else
         {
             SomeKeyPressd?.Invoke(keyCode);
             combineKey = false;
         }
     }
 }