Beispiel #1
0
        private void RecordKeyLog(KeyHookStruct keyHookStr, int keyEvent)
        {
            recordScript.Append($"await Delay({delayWatch.ElapsedMilliseconds});\r\n");
            delayWatch.Restart();

            recordScript.Append(ToKeyMacroFormat(keyHookStr, ( KeyHookEvent )keyEvent));
        }
Beispiel #2
0
 private static void LoggingKeyMacro(KeyHookStruct keyHookStr, int keyEvent)
 {
     if (CommonUtil.CheckMode(ModeKind.CreateLog))
     {
         Logger.WriteKeyEvent(keyHookStr, ( KeyHookEvent )keyEvent);
     }
 }
Beispiel #3
0
        private static Dictionary <string, string> CreateKeyEventLog(KeyHookStruct keyHookStr, KeyHookEvent keyEvent)
        {
            var labeledData = new Dictionary <string, string>
            {
                { "Date", GetDateLog() },
                { "LogKind", "KeyEvent" },
                { "Key", KeyInterop.KeyFromVirtualKey(keyHookStr.virtualKey).ToString() },
                { "Flags", keyHookStr.flags.ToString() },
                { "Event", keyEvent.ToString() }
            };

            return(labeledData);
        }
Beispiel #4
0
        private string ToKeyMacroFormat(KeyHookStruct keyHookStr, KeyHookEvent keyEvent)
        {
            var funcName = KeyFuncDic[keyEvent];

            return($"await {funcName}({keyHookStr.virtualKey});\r\n");
        }
Beispiel #5
0
 public async static Task WriteKeyEventAsync(KeyHookStruct keyHookStr, KeyHookEvent keyEvent)
 {
     await AppendLogAsync(INPUT_LOG_NAME, CreateKeyEventLog( keyHookStr, keyEvent ));
 }
Beispiel #6
0
 public static void WriteKeyEvent(KeyHookStruct keyHookStr, KeyHookEvent keyEvent)
 {
     AppendLog(INPUT_LOG_NAME, CreateKeyEventLog(keyHookStr, keyEvent));
 }