Skip to content

Commit

Permalink
Disable CommandLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris committed May 15, 2020
1 parent 6da72c6 commit b81e329
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion GK6X/CommandLogger.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -2477,3 +2478,4 @@ static extern bool WriteConsole(IntPtr hConsoleOutput, string lpBuffer,
}
}
}
#endif
11 changes: 6 additions & 5 deletions GK6X/KeyboardDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 3 additions & 0 deletions GK6X/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
{
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion GK6X/WebGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit b81e329

Please sign in to comment.