Skip to content
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

Added feature for load/save keyboard layout with their LED settings profile #76

Open
wants to merge 48 commits into
base: main
Choose a base branch
from

Conversation

Tikeri
Copy link

@Tikeri Tikeri commented Apr 21, 2020

Hello,

First of all, thanks for openrazer and RazerGenie.
I have tried it in parallels of Polychromatic but well I like RazerGenie more because of the few reasons below :

  • No big packages dependencies (like *-webkit..., it takes hours to compile it)
  • Simple and quick to use, also does not use any tray applet.. why would we need this ?
  • Matrix discovery which allows customization of each key colourization

Well I've coded with my little knowlegde but it was a bit painfull because of the JSON stuff that is
memory eater and also hard to work with because each modification requires to regenerate the whole JSON document.

So finally the missing feature has been added successfully and now you can save and load your customizations from a file ! (Which helps a lot because if you touch just a little the "lighting mode", it will clears everything you have configured before in the matrix discovery).

It is not yet documented but the idea is to create a parallel JSON document that contains each modification and also stores a new key that contains the color value of each keyboard key.

It works perfectly when running the matrix discovery tool but partially from the classic Custom Editor. The last thing that requires to be fixed (and hopefully it can !) is the rendering on buttons after loading a layout from file, it will be wrong while the good keys are still well illuminated with their colours.

Note to testers : this has been tested with a french layout keyboard and I have done few quick test with en_US layout setting so it requires more tests for now.

z3ntu and others added 24 commits July 31, 2018 13:51
Also add a kind-of working meson target that can be invoked with 'ninja src/libopenrazer/docs/html'
bool Device::setScrollBreathDual(QColor color, QColor color2) was creating a QBusMessage with:

QDBusMessage m = prepareDeviceQDBusMessage("razer.device.lighting.scroll", "setScrollBreathSingle");

Changed it to:

QDBusMessage m = prepareDeviceQDBusMessage("razer.device.lighting.scroll", "setScrollBreathDual");
Previously, all devices supported setting any value as DPI you wanted,
but the DeathAdder 3.5G only has 4 values available so add support for
that.
The 'configure' icon is not a standard icon theme icon and probably only
available in the Breeze theme, so the preferences button was basically
invisible for many users.

Fix this by using the 'preferences-system' icon; and also increase the
size of the icon from 16x16 to 20x20 to make it more visible.

Fixes z3ntu#50
- 'space bar' matrix assigned to [5, 7] to support BlackWidow Chroma v2 RGB
- still no 'razer logo' support for BlackWidow Chroma V2
	  Matrix Discovery
	modified :         src/CMakeLists.txt
	modified :         src/customeditor/customeditor.cpp
	modified :         src/customeditor/customeditor.h
	new file :         src/customeditor/kbdlayout.cpp
	new file :         src/customeditor/kbdlayout.h
	modified :         src/customeditor/matrixpushbutton.cpp
	modified :         src/customeditor/matrixpushbutton.h
	modified :         src/customeditor/customeditor.cpp
	modified :         src/customeditor/matrixpushbutton.cpp
	modified :         src/customeditor/matrixpushbutton.h
… correctly from the standart custom editor, for some reason it looks to be a shift somewhere
@z3ntu
Copy link
Owner

z3ntu commented May 2, 2020

Hi, thanks for the PR! Can you please rebase on master, a large refactoring has been in progress for a while but I've pushed it to the master branch only a week ago, so there are quite a few conflicts now.

z3ntu and others added 4 commits May 2, 2020 14:54
Also add a kind-of working meson target that can be invoked with 'ninja src/libopenrazer/docs/html'
z3ntu and others added 15 commits May 2, 2020 15:09
Previously, all devices supported setting any value as DPI you wanted,
but the DeathAdder 3.5G only has 4 values available so add support for
that.
- 'space bar' matrix assigned to [5, 7] to support BlackWidow Chroma v2 RGB
- still no 'razer logo' support for BlackWidow Chroma V2
	  Matrix Discovery
	modified :         src/CMakeLists.txt
	modified :         src/customeditor/customeditor.cpp
	modified :         src/customeditor/customeditor.h
	new file :         src/customeditor/kbdlayout.cpp
	new file :         src/customeditor/kbdlayout.h
	modified :         src/customeditor/matrixpushbutton.cpp
	modified :         src/customeditor/matrixpushbutton.h
	modified :         src/customeditor/customeditor.cpp
	modified :         src/customeditor/matrixpushbutton.cpp
	modified :         src/customeditor/matrixpushbutton.h
… correctly from the standart custom editor, for some reason it looks to be a shift somewhere
@Tikeri
Copy link
Author

Tikeri commented May 2, 2020

Ok it is done now.
I'm not able to compile it btw since your change with meson stuff. It is looking for libopenrazer that is now missing.
Should works as is.

meson.build:14:2: ERROR: Tried to use 'add_global_arguments' after a build target has been declared.
This is not permitted. Please declare all arguments before your targets.

Fixed.

I still have other things to fix in the code too it seems. Wait for the PR :D

Tikeri added 2 commits May 2, 2020 18:19
Fixed double declaration in customeditor.h
Fixed meson.build to include new kbdlayout.{h,cpp} files like it was done in CMakeLists.txt before
Fixed meson.build in data/ to include the saved layout example file
Fixed some dialog boxes strings to be compatible for translations
Added and updated fr.ts translation file that was there before...
Updated de.fr translation
@Tikeri
Copy link
Author

Tikeri commented May 2, 2020

Well you can now test it and modify it to your convenience.
Updated translations files btw.

@Tikeri
Copy link
Author

Tikeri commented May 3, 2020

Quick question : why did you change the lang container format ?
It was fitting well with the QLocale::system(), it has now to be parsed and compared to what the hardware code returns.

@z3ntu
Copy link
Owner

z3ntu commented Dec 15, 2022

Hi, sorry for the long delay. If you're still interested in this, do you know how this is different to PR #100 ?

@Tikeri
Copy link
Author

Tikeri commented Dec 15, 2022

Hi, sorry for the long delay. If you're still interested in this, do you know how this is different to PR #100 ?

Well PR #76 take care of keyboard layout files + lang and save content inside while PR #100 looks to save only the customization colours into a separated file (*.rgkeys). But less code and files.

I'm not fan of "auto" variables which can leads to unknow behavior :D

We'll have to wait for @gerddie reply.

@gerddie
Copy link
Contributor

gerddie commented Dec 16, 2022

TBH I stopped using RazerGenie, so I never tried to rebase or update #100 otherwise. What I want to say is that I have no strong feelings whether the code lands or not, I'm just unlikely to invest much time in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants