From b81e32980f5c224b9a47b924fe40665433503d06 Mon Sep 17 00:00:00 2001 From: pixeltris <6952411+pixeltris@users.noreply.github.com> Date: Fri, 15 May 2020 18:57:33 +0100 Subject: [PATCH] Disable CommandLogger --- GK6X/CommandLogger.cs | 4 +++- GK6X/KeyboardDevice.cs | 11 ++++++----- GK6X/Program.cs | 3 +++ GK6X/WebGUI.cs | 5 ++++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/GK6X/CommandLogger.cs b/GK6X/CommandLogger.cs index 31883d3..f3f369c 100644 --- a/GK6X/CommandLogger.cs +++ b/GK6X/CommandLogger.cs @@ -1,4 +1,5 @@ -// Based on https://github.com/pixeltris/SonyAlphaUSB/blob/master/SonyAlphaUSB/WIALogger.cs +#if COMMAND_LOGGER_ENABLED +// Based on https://github.com/pixeltris/SonyAlphaUSB/blob/master/SonyAlphaUSB/WIALogger.cs // Taken 30th June 2019 using System; using System.Collections.Generic; @@ -2477,3 +2478,4 @@ static extern bool WriteConsole(IntPtr hConsoleOutput, string lpBuffer, } } } +#endif \ No newline at end of file diff --git a/GK6X/KeyboardDevice.cs b/GK6X/KeyboardDevice.cs index de1f6c0..ebcb593 100644 --- a/GK6X/KeyboardDevice.cs +++ b/GK6X/KeyboardDevice.cs @@ -487,11 +487,12 @@ private byte[] GetResponse(byte op1, byte op2) State.KeysByLogicCode.TryGetValue(callbackId, out key); Program.Log("Index:" + callbackId + " " + (key == null ? "(null)" : - "Name:" + key.KeyName + " " + - "Indx:" + key.LogicCode + " " + - "Loc:" + key.LocationCode + " " + - "D:0x" + key.DriverValue.ToString("X8") + " " + - "E:" + (DriverValue)key.DriverValue)); + "Name:" + key.KeyName + " " +// Name of the key + "Indx:" + key.LogicCode + " " +// 'Indx' for logic code / key index + "Loc:" + key.LocationCode + " " +// 'Loc' for location code + "D:0x" + key.DriverValue.ToString("X8") + " " +// 'D' for DriverValue + //"E:" + (DriverValue)key.DriverValue + " " +// 'E' for the Enum variant of the DriverValue + "S:" + key.DriverValueName));// <--- 'S' for string representation (use this for mapping keys in your UserData file) } } else if (!Crc16.ValidateCrc(resultBufferWithReportId, reportHeaderLen, reportHeaderLen + 6)) diff --git a/GK6X/Program.cs b/GK6X/Program.cs index e654cf5..e25a687 100644 --- a/GK6X/Program.cs +++ b/GK6X/Program.cs @@ -34,11 +34,13 @@ static void Main(string[] args) return; } +#if COMMAND_LOGGER_ENABLED if (args.Length > 0 && args[0].ToLower() == "clog") { CommandLogger.Run(); return; } +#endif KeyboardDeviceManager.Connected += (KeyboardDevice device) => { @@ -145,6 +147,7 @@ static void Main(string[] args) { Log(string.Empty); Log("This is used to identify keys. Press keys to see their values. Missing keys will generally show up as '(null)' and they need to be mapped in the data files Data/devuces/YOUR_MODEL_ID/"); + Log("The 'S' values are what you want to use to map keys in your UserData file."); Log(string.Empty); Log("Entering 'driver' mode and mapping all keys to callbacks."); Log(string.Empty); diff --git a/GK6X/WebGUI.cs b/GK6X/WebGUI.cs index 9dc050c..e8b7a9b 100644 --- a/GK6X/WebGUI.cs +++ b/GK6X/WebGUI.cs @@ -22,7 +22,10 @@ public static void Run() if (!server.IsRunning) { server.Start(); - Program.Log("Started web GUI server at " + url); + if (server.IsRunning) + { + Program.Log("Started web GUI server at " + url); + } } if (server.IsRunning) {