-
Notifications
You must be signed in to change notification settings - Fork 311
Nightsword RGB support #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ghting zones work.
…urrently as profswitch, and profdn is not detected) and adjusted pos/size values for the gui. All features accounted for except for aforementioned profile switching issue.
|
Could you poke me in IRC? I want to at least figure out what the scancodes are for the profile buttons. |
|
Ping @openaiken, we still need to get that scancode added. |
|
I’ll take a stab with my USB sniffer tonight |
|
Nightsword USB Scan Code Usual C code: or The scan codes for the wheel activity is:
The scan codes for the button activities are:
USB MonitoringTo collect a raw text trace, execute following steps.
Mount # mount -t debugfs none_debugs /sys/kernel/debug
# modprobe usbmon
#Verify that bus sockets are present. # ls /sys/kernel/debug/usb/usbmon
0s 0u 1s 1t 1u 2s 2t 2u 3s 3t 3u 4s 4t 4u
#Now you can choose to either use the socket '0u' (to capture packets on all
Run " Example: T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1b1c ProdID=1b5c Rev= 3.35
S: Manufacturer=Corsair
S: Product=CORSAIR NIGHTSWORD RGB Gaming Mouse
S: SerialNumber=02027026AF4C18865CC0F81CF5001BC0
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=1ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=1ms
E: Ad=02(O) Atr=03(Int.) MxPS= 64 Ivl=1ms" Bus 001 Device 002: ID 1b1c:1b5c Corsair CORSAIR NIGHTSWORD RGB Gaming Mouse
# cat /sys/kernel/debug/usb/usbmon/1u > /tmp/1.mon.outto listen on a single bus, otherwise, to listen on all buses, type: # cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.outThis process will read until it is killed. Naturally, the output can be
This is where you do something that creates the traffic: plug in a flash key,
Usually it's done with a keyboard interrupt (Control-C). At this point the output file ( USB Raw Dump OutputAll USB scan code capture were done by performing each specific actions three times. usb-bus1-mouse-left-buttonffff95a543223780 448005372 C Ii:1:002:1 0:1 10 = 01010000 00000000 0000
ffff95a543223780 448005423 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 448254370 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 448254417 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 449476370 C Ii:1:002:1 0:1 10 = 01010000 00000000 0000
ffff95a543223780 449476415 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 449656370 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 449656417 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 450962372 C Ii:1:002:1 0:1 10 = 01010000 00000000 0000
ffff95a543223780 450962417 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 451102371 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 451102415 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-left-side-away.txtffff95a543223780 823168470 C Ii:1:002:1 0:1 10 = 01100000 00000000 0000
ffff95a543223780 823168523 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 823369472 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 823369518 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 824550473 C Ii:1:002:1 0:1 10 = 01100000 00000000 0000
ffff95a543223780 824550517 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 824731472 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 824731516 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 826009472 C Ii:1:002:1 0:1 10 = 01100000 00000000 0000
ffff95a543223780 826009516 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 826184472 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 826184512 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-left-side-big.txtffff95a543223780 765281456 C Ii:1:002:1 0:1 64 = 03800000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 765281500 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 765468455 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 765468488 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 766619456 C Ii:1:002:1 0:1 64 = 03800000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 766619493 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 766811456 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 766811488 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 768048456 C Ii:1:002:1 0:1 64 = 03800000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 768048492 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 768210452 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 768210480 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-left-side-closer.txtffff95a543223780 868313483 C Ii:1:002:1 0:1 10 = 01080000 00000000 0000
ffff95a543223780 868313536 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 868494484 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 868494528 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 869673483 C Ii:1:002:1 0:1 10 = 01080000 00000000 0000
ffff95a543223780 869673529 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 869848485 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 869848530 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 871053492 C Ii:1:002:1 0:1 10 = 01080000 00000000 0000
ffff95a543223780 871053532 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 871217484 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 871217529 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-middle-button-away.txtffff95a543223780 1440829637 C Ii:1:002:1 0:1 64 = 03000000 01000000 00000000 000
00000 00000000 00000000 00000000 00000000
ffff95a543223780 1440829678 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 1440995635 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 000
00000 00000000 00000000 00000000 00000000
ffff95a543223780 1440995665 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 1442067638 C Ii:1:002:1 0:1 64 = 03000000 01000000 00000000 000
00000 00000000 00000000 00000000 00000000
ffff95a543223780 1442067672 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 1442226637 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 000
00000 00000000 00000000 00000000 00000000
ffff95a543223780 1442226670 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 1443372640 C Ii:1:002:1 0:1 64 = 03000000 01000000 00000000 000
00000 00000000 00000000 00000000 00000000
ffff95a543223780 1443372673 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 1443531637 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 000
00000 00000000 00000000 00000000 00000000
ffff95a543223780 1443531670 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-middle-button-closer.txtffff95a543223780 624422417 C Ii:1:002:1 0:1 64 = 03000000 02000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 624422456 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 624573416 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 624573445 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 625538416 C Ii:1:002:1 0:1 64 = 03000000 02000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 625538449 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 625713415 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 625713444 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 626713418 C Ii:1:002:1 0:1 64 = 03000000 02000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 626713451 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 626832414 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 626832440 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-right-button.txtffff95a543223780 486940382 C Ii:1:002:1 0:1 10 = 01020000 00000000 0000
ffff95a543223780 486940435 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 487106380 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 487106426 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 488270382 C Ii:1:002:1 0:1 10 = 01020000 00000000 0000
ffff95a543223780 488270427 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 488406379 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 488406423 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 489627382 C Ii:1:002:1 0:1 10 = 01020000 00000000 0000
ffff95a543223780 489627429 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 489776379 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 489776423 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-top-left-side-away.txtffff95a543223780 688691435 C Ii:1:002:1 0:1 64 = 03200000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 688691482 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 688872433 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 688872465 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 689828434 C Ii:1:002:1 0:1 64 = 03200000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 689828473 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 689980434 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 689980471 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 691131436 C Ii:1:002:1 0:1 64 = 03200000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 691131473 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 691283434 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 691283470 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-top-left-side-closer.txtffff95a543223780 726345446 C Ii:1:002:1 0:1 64 = 03400000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 726345490 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 726560445 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 726560480 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 727543445 C Ii:1:002:1 0:1 64 = 03400000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 727543481 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 727750444 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 727750477 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 728731445 C Ii:1:002:1 0:1 64 = 03400000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 728731481 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 728901446 C Ii:1:002:1 0:1 64 = 03000000 00000000 00000000 0000
0000 00000000 00000000 00000000 00000000
ffff95a543223780 728901477 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-wheel-down.txtffff95a543223780 286759326 C Ii:1:002:1 0:1 10 = 01000000 00000000 00ff
ffff95a543223780 286759374 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 287921327 C Ii:1:002:1 0:1 10 = 01000000 00000000 00ff
ffff95a543223780 287921368 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 289758329 C Ii:1:002:1 0:1 10 = 01000000 00000000 00ff
ffff95a543223780 289758371 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-wheel-press.txtffff95a543223780 368546348 C Ii:1:002:1 0:1 10 = 01040000 00000000 0000
ffff95a543223780 368546394 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 368767350 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 368767396 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 369938348 C Ii:1:002:1 0:1 10 = 01040000 00000000 0000
ffff95a543223780 369938394 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 370090348 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 370090391 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 371317349 C Ii:1:002:1 0:1 10 = 01040000 00000000 0000
ffff95a543223780 371317395 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 371491350 C Ii:1:002:1 0:1 10 = 01000000 00000000 0000
ffff95a543223780 371491396 S Ii:1:002:1 -115:1 64 <usb-bus1-mouse-wheel-up.txtffff95a543223780 204353305 C Ii:1:002:1 0:1 10 = 01000000 00000000 0001
ffff95a543223780 204353360 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 205768304 C Ii:1:002:1 0:1 10 = 01000000 00000000 0001
ffff95a543223780 205768350 S Ii:1:002:1 -115:1 64 <
ffff95a543223780 207230306 C Ii:1:002:1 0:1 10 = 01000000 00000000 0001
ffff95a543223780 207230350 S Ii:1:002:1 -115:1 64 < |
|
With that, I was able to find the scancode. Someone please test the new code so that I can merge this. |
|
seems to be working |
|
Both lighting and mapping working here. |
|
Works very well with my Nightsword (although there's some minor non-functional-impacting typo in the source code. Also, the Corsair K95 Platinum with Brown Cherry MX works very well. We should package this. |
|
woohoo! Thank y'all so much for tying up the loose ends with this! Really glad it's officially supported now. Sorry @Ravenslofty , I meant to drop in a second time but I neglected to. Thank you again for your help with this. |
Hello! I have added Nightsword RGB support. All critical functionality has been added (all lighting zones, and binding for all[*] keys).
This does not add support for some of the model specific features seen in iCUE, such as the visual mapping of the consumer-configurable counter-weights (accessed from a panel on the bottom of the device), or the calibration feature (where you drag the cursor in a spiral to adjust x/y sensitivity after adjusting counter-weights). This is due to both A) these features not being supported by the version of the corsair protocol that ckb-next uses, and B) not having these features designed in the GUI (and hooboy do I NOT want to be the one to do that!).
[*] The key that there is not binding for yet is the Profile Up/Down switches. The Profile Up switch is detected as "profswitch" (see /src/daemon/keymap.c) as verified by monitoring /dev/input/ckbX/notify1, and the Profile Down switch is not detected at all. This is probably not a terribly complicated fix, but it involves touching stuff related to the daemon and the protocol, which I'm not familiar with yet. On my personal profile for the mouse I just set the Profile Up key to cycle through profiles.