pixeltris/GK6X

How to run it on linux?

Ovsyanka opened this issue ยท 19 comments

Could you share some instuctions how to run it on linux? As I understand I should compile it somehow. But I am ot sure how. I tried to install msbuild, but I didn't succeed so far (I got dependency errors). Is it at least the right direction?

I managed to run it on Arch linux:

  1. Install mono package

  2. run xbuild GK6X.sln

There is warnings:

>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<

GK6X.sln:  warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
  1. run program
cd Build
sudo mono GK6X.exe

I run it from the Build directory because it expects Data/i18n/langs direcroty in the current path and raise the exception if it is not there:

Unhandled Exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path '.../Data/i18n/langs'.

Thanks for documenting your findings for getting it to build on Linux. The latest versions of mono should include msbuild so you should be able to use that rather than the deprecated xbuild.

And yes the working directory should be in the Build directory as the code loads files relative to the current working directory rather than relative to where the exe is. It wouldn't be too hard to make the paths relative to the exe location but for now I'll leave it as it is.

If I am not mistaken, current arch mono package (6.0.0.334-1) doesn't contain msbuild.

Thanks for your reply. I think it would be nice to add these instructions into documentation page. I could make the PR if you prefere. Should I?

Thank you so much! The instructions on this bug were VERY helpful, and now I have a useful keyboard! This is MUCH nicer than the original software and I don't have to boot a VM to use it.

Thank you all so much!

Really great software! I have one quick question.

My GK64 came with | mapped to # and it's very annoying. Based on the sample config I'm trying to remap it using the following but it doesn't seem to work. Any advice?

[Base,Layer1,Layer2,Layer3,FnLayer1,FnLayer2,FnLayer3]
[Lighting(White light respiration,Base)]
[Lighting(Windmill,Base)]
[Lighting(Red light respiration,Base)]
[Lighting(Starlish,Base)]
Pause:Delete
|:|

I don't think I added support for mapping special character codes ~<>?:"|{}ยฑ!_( etc to their key counterparts. Instead you'll have to find the textual name for that key, the list of keys are defined here

public enum DriverValue : uint
you might have to play around with it to find what you're looking for as I'm not quite sure in this case. You might be looking for the Backslash value? So maybe test doing Backslash:A to first change it to the A key, then find out how to redirect it to what you want it to be by playing around with the values. Note that doing Backslash:Backslash wouldn't do anything as you need to map a key from a value to a different value, using the same value as itself is the same as no change.

Also I think [Lighting(xxxxxx)] clears out the current target layer type which might mess things up. [Base,Layer1,Layer2,Layer3,FnLayer1,FnLayer2,FnLayer3] is used to set up key mappings which should follow in the lines below.

Brilliant @pixeltris thanks for the response.

Also I think [Lighting(xxxxxx)] clears out the current target layer type which might mess things up.

Turns out that the ordering of that config did mess things up. I can confirm that Backslash:A works as expected now that I've removed those Lighting lines.

As for the keycode for I've settled with Backslash:AltBackslash, which is good enough for now. Many thanks for the pro tips.

Cross-reference #3

Hello guys,
Newbie to Linux here, wanted to use my keyboard on Ubuntu 18.04 LTS Bionic Beaver.
After following the above steps i got the two following errors
Unhandled Exception:
HidSharp.Exceptions.DeviceUnauthorizedAccessException: Not permitted to open HID class device at /dev/hidraw1.
at HidSharp.Platform.Linux.LinuxHidStream.DeviceHandleFromPath (System.String path, HidSharp.HidDevice hidDevice, HidSharp.Platform.Linux.NativeMethods+oflag oflag) [0x000bb] in :0
at HidSharp.Platform.Linux.LinuxHidDevice.TryParseReportDescriptor (HidSharp.Reports.ReportDescriptor& parser, System.Byte[]& reportDescriptor) [0x0000f] in :0
at HidSharp.Platform.Linux.LinuxHidDevice.RequiresGetInfo () [0x00017] in :0
at HidSharp.Platform.Linux.LinuxHidDevice.GetMaxInputReportLength () [0x00000] in :0
at GK6X.KeyboardDeviceManager.RefreshConnectedDevices () [0x0005d] in <166f4681c3854609829b276666821d7f>:0
at GK6X.KeyboardDeviceManager.StartListener () [0x00020] in <166f4681c3854609829b276666821d7f>:0
at GK6X.Program.Main (System.String[] args) [0x000cd] in <166f4681c3854609829b276666821d7f>:0
[ERROR] FATAL UNHANDLED EXCEPTION: HidSharp.Exceptions.DeviceUnauthorizedAccessException: Not permitted to open HID class device at /dev/hidraw1.
at HidSharp.Platform.Linux.LinuxHidStream.DeviceHandleFromPath (System.String path, HidSharp.HidDevice hidDevice, HidSharp.Platform.Linux.NativeMethods+oflag oflag) [0x000bb] in :0
at HidSharp.Platform.Linux.LinuxHidDevice.TryParseReportDescriptor (HidSharp.Reports.ReportDescriptor& parser, System.Byte[]& reportDescriptor) [0x0000f] in :0
at HidSharp.Platform.Linux.LinuxHidDevice.RequiresGetInfo () [0x00017] in :0
at HidSharp.Platform.Linux.LinuxHidDevice.GetMaxInputReportLength () [0x00000] in :0
at GK6X.KeyboardDeviceManager.RefreshConnectedDevices () [0x0005d] in <166f4681c3854609829b276666821d7f>:0
at GK6X.KeyboardDeviceManager.StartListener () [0x00020] in <166f4681c3854609829b276666821d7f>:0
at GK6X.Program.Main (System.String[] args) [0x000cd] in <166f4681c3854609829b276666821d7f>:0

Help would be appreciated.

The README has been updated to clarify how to compile / run on Linux / Mac.

Thanks a lot @everyone! ๐Ÿ˜…

After revisiting this project I get a lot of build errors on Ubuntu 18.04 with the mono-complete package. Lots of errors relating to missing definition of basic types like System.Object and System.Int32 etc.

To overcome those errors I use the following command:

xbuild /p:TargetFrameworkVersion=v4.5 /p:TargetFrameworkProfile="" GK6X.sln

Hope this is useful to someone.

Hi guys,
I'm a macOS user and I am having issues remapping my LAlt and LWin keys to be better suited to macOS

This is what I'm doing.

[Base,Layer1,Layer2,Layer3,FnLayer1,FnLayer2,FnLayer3]
Left GUI:LAlt
Left Alt:LWin

any help would be appreciated.

hey my keyword dosn't give any input but it lights up but some times it works.

can i make keyboard lights white

izmoz commented

Hi, i faced with some problems with your software, when i open gui in browser, i've this blurry line in bottom half of screen and i cant hit any button, is it some bug?
Screenshot_20220221_175552

@tinydumb that's the same problem as in #181 resize your browser to fix it.

izmoz commented

@pixeltris thanks a lot, u're saved my ass, because my drivers get broke, have a good day!