Пример #1
0
        private string ToMouseMacroFormat(MouseHookStruct mouseHookStr, MouseHookEvent mouseEvent)
        {
            var funcName = MouseFuncDic[mouseEvent];

            if (mouseEvent == MouseHookEvent.Wheel || mouseEvent == MouseHookEvent.Hwheel)
            {
                return($"await {funcName}({mouseHookStr.coordinatePoint.x}, {mouseHookStr.coordinatePoint.y}, {GetWheelData( mouseHookStr.mouseData )});\r\n");
            }
            else
            {
                return($"await {funcName}({mouseHookStr.coordinatePoint.x}, {mouseHookStr.coordinatePoint.y});\r\n");
            }
        }
Пример #2
0
 public static void WriteMouseEvent(MouseHookStruct mouseHookStr, MouseHookEvent mouseEvent)
 {
     AppendLog(INPUT_LOG_NAME, CreateMouseEventLog(mouseHookStr, mouseEvent));
 }
Пример #3
0
 public async static Task WriteMouseEventAsync(MouseHookStruct mouseHookStr, MouseHookEvent mouseEvent)
 {
     await AppendLogAsync(INPUT_LOG_NAME, CreateMouseEventLog( mouseHookStr, mouseEvent ));
 }
Пример #4
0
        private static Dictionary <string, string> CreateMouseEventLog(MouseHookStruct mouseHookStr, MouseHookEvent mouseEvent)
        {
            var labeledData = new Dictionary <string, string>
            {
                { "Date", GetDateLog() },
                { "LogKind", "MouseEvent" },
                { "X", mouseHookStr.coordinatePoint.x.ToString() },
                { "Y", mouseHookStr.coordinatePoint.y.ToString() },
                { "MouseData", mouseHookStr.mouseData.ToString() },
                { "Flags", mouseHookStr.flags.ToString() },
                { "Event", mouseEvent.ToString() }
            };

            return(labeledData);
        }