Code Monkey home page Code Monkey logo

Comments (12)

khaledose avatar khaledose commented on May 27, 2024 1

so after many trial and errors and tracing your code i found out that there is no entry for index 8 in keymap.js and that's why it didn't recognize that key so i changed it and it finally worked

from gk6x.

pixeltris avatar pixeltris commented on May 27, 2024

That's odd I can map both RAlt and RCtrl to Left on my keyboard (GK84). Are you able to map RAlt to Left on the official software? Could you try typing the dumpkeys ex command to print a list of the keys in the order that they appear on the keyboard to see if there is a key miss-match. For example my GK84 prints:

====== 655491200 ======
Escape = Esc
F1 = F1
F2 = F2
F3 = F3
F4 = F4
F5 = F5
F6 = F6
F7 = F7
F8 = F8
F9 = F9
F10 = F10
F11 = F11
F12 = F12
Print Screen = Screenshot
Scroll Lock = ScrollLock
Pause = Pause
--------
` = BackTick
1 = D1
2 = D2
3 = D3
4 = D4
5 = D5
6 = D6
7 = D7
8 = D8
9 = D9
0 = D0
- = Subtract
= = Add
Backspace = Backspace
Home = Home
--------
Tab = Tab
Q = Q
W = W
E = E
R = R
T = T
Y = Y
U = U
I = I
O = O
P = P
[ = OpenSquareBrace
] = CloseSquareBrace
| = Backslash
Page Up = PageUp
--------
Caps Lock = CapsLock
A = A
S = S
D = D
F = F
G = G
H = H
J = J
K = K
L = L
; = Semicolon
' = Quotes
Return = Enter
Page Down = PageDown
--------
Left Shift = LShift
Z = Z
X = X
C = C
V = V
B = B
N = N
M = M
, = Comma
. = Period
/ = Slash
Right Shift = RShift
Up Arrow = Up
End = End
--------
Left Control = LCtrl
Left GUI = LWin
Left Alt = LAlt
Space = Space
Right Alt = RAlt
Fn = 4294967295
Right Control = RCtrl
Left Arrow = Left
Down Arrow = Down
Right Arrow = Right
--------

from gk6x.

khaledose avatar khaledose commented on May 27, 2024

`yes it's remappable on the official software
here is the output of dumpkeys

====== 656801801 ======
Escape = Esc
1 = D1
2 = D2
3 = D3
4 = D4
5 = D5
6 = D6
7 = D7
8 = D8
9 = D9
0 = D0
- = Subtract
= = Add
Backspace = Backspace
Tab = Tab
Q = Q
W = W
E = E
R = R
T = T
Y = Y
U = U
I = I
O = O
P = P
[ = OpenSquareBrace
] = CloseSquareBrace
| = Backslash
Caps Lock = CapsLock
A = A
S = S
D = D
F = F
G = G
H = H
J = J
K = K
L = L
; = Semicolon
' = Quotes
Return = Enter
Up Arrow = Up
Delete = Delete
Left Shift = LShift
Z = Z
X = X
C = C
V = V
B = B
N = N
M = M
, = Comma
. = Period
/ = Slash
Right Shift = RShift
Left Control = LCtrl
Left GUI = LWin
Left Alt = LAlt
Space = Space
Fn = 4294967295
Right Control = RCtrl
Left Arrow = Left
Down Arrow = Down
Right Arrow = Right

it says that i have RCtrl although it's RAlt on my keyboard`

from gk6x.

pixeltris avatar pixeltris commented on May 27, 2024

https://github.com/pixeltris/GK6X/tree/master/Build/Data/device/656801801/data go into all of the json files here and try replacing 0x02000010 with 0x02000040. What that will do is state that the key should be RAlt. What I think is happening is that because it's currently listed as RCtrl in the data files it fails to map the key because it's actually meant to be RAlt.

You might also need to modify this

"KeyName": "Right Control",
but I think those strings are mostly for displaying info such as in the key dumps.

It could also be possible that it detected the wrong model ID somehow? Thinking about it, it should work by mapping RCtrl as that's what the equivalent key should be, not sure why it isn't working.

from gk6x.

khaledose avatar khaledose commented on May 27, 2024

i changed the addresses as you said and recompiled and still can't be changed. also i was thinking about the model number maybe it's wrong as you said but i don't know how to find out the model number of my keyboard

from gk6x.

pixeltris avatar pixeltris commented on May 27, 2024

I guess it should be correct as the model ID is obtained from what is sent from the keyboard to the PC.

It was 5 months ago that I last obtained the data files so it could be they need updating, I'll look into doing that at some point.

There are a few things that I could suggest to try and find what the key index actually is (but it might be a bit more effort than you care to exert!)

public void SetKeys(KeyboardLayer layer, uint[] values, bool fn)

Go through all of the indexes in the values array one by one and change the value to something like 0x02005000 (the 'Left' key). When you find the index that matches your RAlt key you should be able to update the .json files with the appropriate index and it should work. Avoid changing all keys at once as it'll make your keyboard unusable until you reset it.

  1. Use the CommandLogger https://github.com/pixeltris/GK6X/tree/master/CommandLogger to see what is being sent from the official software. Unfortunately the CommandLogger isn't really set up to produce decent logs, it was just something I hacked together to document all the packets. You will want to put a log Log("keys: " + packet.ToString()) after the following line and see the output in the CommandLogger.txt file

static void ProcessSetKeys(Packet packet, bool fn)

from gk6x.

khaledose avatar khaledose commented on May 27, 2024

so i was able to find the index of RAlt it was 8 and when i hard code the left key in the code it maps successfully to left but when i change the index in the json files and try to map it nothing happens

also when i try to print values[8] it prints this 4294967295 the value of function key

from gk6x.

pixeltris avatar pixeltris commented on May 27, 2024

That's great that you got it working. I'll look into updating the data files at some point anyway as I imagine they should include that key (and possibly others on other keyboards) as the official software did work for you. It would be great if you could make a PR or comment here what changes you made so that someone could manually fix any similar issues that they might have.

from gk6x.

khaledose avatar khaledose commented on May 27, 2024

so the changes i made in order to be able to map the right alt key are as following in the keymap.js file of my device

i changed this
{ "KeyName": "Right Control", "Show": "Ctrl", "LogicCode": 6, "LocationCode": 99, "Position": { "Left": 794, "Top": 386, "Width": 50, "Height": 50 } }

to this
{ "KeyName": "Right Alt", "Show": "Alt", "LogicCode": 8, "LocationCode": 120, "Position": { "Left": 794, "Top": 386, "Width": 50, "Height": 50 } }

also i want to thank you for your help and really you did a great job

last thing i wanted to ask is it possible to change the light control key combos? like the ( fn+up ) or ( fn+] ) and change it to fn key and anything else?

from gk6x.

pixeltris avatar pixeltris commented on May 27, 2024

Thanks!

There are some lighting keys here but as noted the ones which cycle the lighting effects only work on the base layer, and it isn't possible to reprogram the base layer fn keys due to limitations in the firmware.

from gk6x.

khaledose avatar khaledose commented on May 27, 2024

great thanks a lot i will play with it and see what i can do

from gk6x.

pixeltris avatar pixeltris commented on May 27, 2024

The data files have been updated, so any mismatched keys should now (hopefully) be fixed.

from gk6x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.