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"); } }
public static void WriteMouseEvent(MouseHookStruct mouseHookStr, MouseHookEvent mouseEvent) { AppendLog(INPUT_LOG_NAME, CreateMouseEventLog(mouseHookStr, mouseEvent)); }
public async static Task WriteMouseEventAsync(MouseHookStruct mouseHookStr, MouseHookEvent mouseEvent) { await AppendLogAsync(INPUT_LOG_NAME, CreateMouseEventLog( mouseHookStr, mouseEvent )); }
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); }