コード例 #1
0
ファイル: Keybinds.cs プロジェクト: jaydeshow/CLU
 /// <summary>
 /// checks to see if the specified key has been pressed within wow.
 /// </summary>
 /// <param name="key">The key to check for (see Keyboardfunctions)</param>
 /// <returns>true if the player has pressed the key</returns>
 private static bool IsKeyDown(Keyboardfunctions key)
 {
     try
     {
         if (key == Keyboardfunctions.Nothing)
         {
             return(false);
         }
         var raw = Lua.GetReturnValues("if " + key.ToString("g") + "() then return 1 else return 0 end");
         return(raw[0] == "1");
     }
     catch
     {
         CLULogger.DiagnosticLog("Lua failed in IsKeyDown" + key.ToString("g"));
         return(false);
     }
 }
コード例 #2
0
ファイル: Keybinds.cs プロジェクト: Asphodan/Alphabuddy
 /// <summary>
 /// checks to see if the specified key has been pressed within wow.
 /// </summary>
 /// <param name="key">The key to check for (see Keyboardfunctions)</param>
 /// <returns>true if the player has pressed the key</returns>
 private static bool IsKeyDown(Keyboardfunctions key)
 {
     try {
         if (key == Keyboardfunctions.Nothing) return false;
         var raw = Lua.GetReturnValues("if " + key.ToString("g") + "() then return 1 else return 0 end");
         return raw[0] == "1";
     } catch {
         CLULogger.DiagnosticLog("Lua failed in IsKeyDown" + key.ToString("g"));
         return false;
     }
 }