razerCommander icon indicating copy to clipboard operation
razerCommander copied to clipboard

Add ability to toggle fn lock/fix game mode not hiding

Open godzillaba opened this issue 8 years ago • 3 comments

My blade stealth doesn't support game mode but when I open the application, the switch still shows. If I select my device in the dropdown it hides like it's supposed to. I made the container of the switch no_show_all and that seemed to fix the problem.

In my device folder (/sys/bus/hid/drivers/razerkbd/<DEVICE ID>/) there is a file called fn_toggle. Writing a 1 or 0 to this file changes the behavior of the F keys (like fn lock, which my keyboard does not have). I added a switch to the right of the game mode switch that only shows if the selected device has a fn_toggle file.

Unfortunately there is nothing in the razer-drivers python client for this fn lock functionality, so I opted to just write directly to fn_toggle. Furthermore, fn_toggle is write only, so the switch may not accurately show if 'fn-lock' is on/off.

I'm not sure if this feature has enough demand to justify these somewhat sketchy additions, but please let me know what you think!

godzillaba avatar Jan 11 '17 21:01 godzillaba

That's really nice! I will review the code and merge this PR as soon as I can! Sorry if I am a bit slow on razercommander's development lately, I'll get back on track soon!

GabMus avatar Jan 11 '17 23:01 GabMus

Thanks!

What do you think about writing to some file in ~/.config/razercommander/ that stores fn-lock states as json? As long as the fn_toggle file isn't written to outside of razercommander, the switch can accurately reflect the fn-lock state (even through reboot). If this isn't a crap idea let me know and I'll get to it!

no rush btw :)

godzillaba avatar Jan 14 '17 19:01 godzillaba

Nice idea to have such a switch in the software. Not sure about the config file - but I'm interested in others opinions here. Thanks for this software and bringing functionality forward.

TheRealBro avatar Mar 20 '17 09:03 TheRealBro