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

Support for keyboards #453

Open
stephanlachnit opened this issue Dec 27, 2019 · 28 comments
Open

Support for keyboards #453

stephanlachnit opened this issue Dec 27, 2019 · 28 comments

Comments

@stephanlachnit
Copy link
Member

Since we have now support for several keyboards, we should think about keyboard support in Piper. This thread is for discussion.

cc @FFY00

@stephanlachnit
Copy link
Member Author

stephanlachnit commented Dec 27, 2019

Current roadmap:

  • Clickable svgs (Make the buttons in the SVG clickable for configuration #71) because GTK buttons will look to messy for this many buttons
  • Rewrite MouseMap to not show buttons (only for keyboards?)
  • Make Piper check which pages to draw
  • Allow bigger svgs for keyboards
  • Add DeviceType property to device files (if necessary)

@stephanlachnit
Copy link
Member Author

#329 gives an example for an application with clickable svgs using GTK/Python. I don't think I'll have time to look into that code before February, just wanted to mention it.

@FFY00 FFY00 added the question label Dec 27, 2019
@FFY00
Copy link
Member

FFY00 commented Dec 27, 2019

#329 shows a good path forward.

I am not sure if we need to add a DeviceType property. My thought was that we could move forward with the clickable buttons and automatically hide the configuration buttons on the side if there was no space left. This would also adapt piper better for smaller screens. We could even remove the configuration buttons entirely but that is something that will need more testing.

@FFY00
Copy link
Member

FFY00 commented Dec 27, 2019

Add MouseMap equivalent (ie KeyboardMap)

I am not sure what this is supposed to be.

@stephanlachnit
Copy link
Member Author

stephanlachnit commented Dec 27, 2019

Add MouseMap equivalent (ie KeyboardMap)

I am not sure what this is supposed to be.

mousemap.py is the file responsible for drawing the svgs and the buttons if I got it right.

My thought was that we could move forward with the clickable buttons and automatically hide the configuration buttons on the side if there was no space left.

That's a very good idea. However we might run into problems, but we have to check the MouseMap for this. Anyway, I think we can both agree that the starting point should be clickable svgs for mice, and then the actual keyboard integration.

I am not sure if we need to add a DeviceType property.

With your idea it's definitely less obvious. Still could be useful for svg-size checks or the resolution page, but I think that's something we'll see on the way while implementing it.

@FFY00
Copy link
Member

FFY00 commented Dec 27, 2019

mousemap.py is the file responsible for drawing the svgs and the buttons if I got it right.

Ah, ok.

That's a very good idea. However we might run into problems, but we have to check the MouseMap for this. Anyway, I think we can both agree that the starting point should be clickable svgs for mice, and then the actual keyboard integration.

Yes. That sounds like a good plan.

With your idea it's definitely less obvious. Still could be useful for svg-size checks or the resolution page, but I think that's something we'll see on the way while implementing it.

Yeah, I think this is something we should discuss when we have some kind of implentation.

@GitJamz
Copy link

GitJamz commented Jan 13, 2020

yes please support for the logitech craft keyboard!

@stephanlachnit
Copy link
Member Author

Looking at #479 we might not need to do anything, looks pretty good so far. Could get problematic if we allow to remap every key, including normal alphanumeric keys, but we probably shouldn't allow that in Piper anyway.

@GitJamz
Copy link

GitJamz commented Mar 19, 2020

how is it going with piper support for logitech craft?

@hwooo
Copy link

hwooo commented Mar 21, 2020

Please support for K580

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

Please try adding a device file for those devices (both should use the hidpp20 driver) and see what works in the current driver.

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

Please try adding a device file for those devices (both should use the hidpp20 driver) and see what works in the current driver.

Some instructions please for a total newbie with these stuff...?

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

Please run the daemon with verbosity and paste the output here.

$ sudo killall ratbagd
$ sudo ratbag --verbose=debug

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

Please run the daemon with verbosity and paste the output here.

$ sudo killall ratbagd
$ sudo ratbag --verbose=debug
ratbag: command not found

ratbagd though:

Initializing libratbag
ratbag debug: New device: AsusTek Computer Inc. AURA LED Controller
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 0b05:1872
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c541
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c541
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c541
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c539
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c539
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c539
ratbag debug: New device: MX Master 2S
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: device assigned driver hidpp20
ratbag debug: hidraw info: bus 0x05 vendor 0x46d product 0xffffb019
ratbag debug: MX Master 2S is device '/dev/hidraw8'.
ratbag debug: Parsing HID report descriptor
ratbag debug: Parsing HID report descriptor
ratbag debug: - HID report ID 01
ratbag debug: - HID report ID 02
ratbag debug: - HID report ID 11
ratbag debug: hidpp: device supports long reports
ratbag debug: 'MX Master 2S' is using protocol v4.5
ratbag debug: device battery level is 90% (next 50%), status 0 
ratbag debug: device has programmable keys/buttons
ratbag debug: device has 8 buttons
ratbag debug: device has adjustable dpi
ratbag debug: device is at 1150 dpi (variable between 200 and 4000).
ratbag debug: device is at 1150 dpi (variable between 200 and 4000).
ratbag debug: device has 8 buttons
ratbag debug: driver match found: Logitech HID++2.0
hidraw8: "MX Master 2S", 1 profiles
ratbag debug: New device: Keyboard Craft
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:b350
DBus server ready

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

Typo, it should be ratbagd.

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

Typo, it should be ratbagd.

I noticed after a min..
I edited my post.

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

The keyboard is connected via bluetooth right?

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

The keyboard is connected via bluetooth right?

Keyboard and mouse is connected with bluetooth correct.

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

Okay, please create a file in /usr/share/libratbag/logitech-craft.device with the following content:

[Device]
Name=Logitech Craft
DeviceMatch=bluetooth:046d:b350
Driver=hidpp20

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

[Device]
Name=Logitech Craft
DeviceMatch=bluetooth:046d:b350
Driver=hidpp20

Done..
You believe this problem is because of my keyboard?

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

new debug:

Initializing libratbag
ratbag debug: New device: AsusTek Computer Inc. AURA LED Controller
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 0b05:1872
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c541
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c541
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c541
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c539
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c539
ratbag debug: New device: Logitech USB Receiver
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c539
ratbag debug: New device: MX Master 2S
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: device assigned driver hidpp20
ratbag debug: hidraw info: bus 0x05 vendor 0x46d product 0xffffb019
ratbag debug: MX Master 2S is device '/dev/hidraw8'.
ratbag debug: Parsing HID report descriptor
ratbag debug: Parsing HID report descriptor
ratbag debug: - HID report ID 01
ratbag debug: - HID report ID 02
ratbag debug: - HID report ID 11
ratbag debug: hidpp: device supports long reports
ratbag debug: 'MX Master 2S' is using protocol v4.5
ratbag debug: device battery level is 90% (next 50%), status 0 
ratbag debug: device has programmable keys/buttons
ratbag debug: device has 8 buttons
ratbag debug: device has adjustable dpi
ratbag debug: device is at 1150 dpi (variable between 200 and 4000).
ratbag debug: device is at 1150 dpi (variable between 200 and 4000).
ratbag debug: device has 8 buttons
ratbag debug: driver match found: Logitech HID++2.0
hidraw8: "MX Master 2S", 1 profiles
ratbag debug: New device: Keyboard Craft
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: device assigned driver hidpp20
ratbag debug: hidraw info: bus 0x05 vendor 0x46d product 0xffffb350
ratbag debug: Keyboard Craft is device '/dev/hidraw7'.
ratbag debug: Parsing HID report descriptor
ratbag debug: Parsing HID report descriptor
ratbag debug: - HID report ID 01
ratbag debug: - HID report ID 02
ratbag debug: - HID report ID 03
ratbag debug: - HID report ID 11
ratbag debug: hidpp: device supports long reports
ratbag debug: 'Keyboard Craft' is using protocol v4.5
ratbag debug: device battery level is 0% (next 0%), status 1 
ratbag debug: device has programmable keys/buttons
ratbag debug: device has 24 buttons
ratbag debug: device has 24 buttons
ratbag debug: driver match found: Logitech HID++2.0
hidraw7: "Keyboard Craft", 1 profiles
DBus server ready

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

Can you test piper and see what is working?

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

Well Now it looks different. It shows me both mouse and keybord to configure at start.
But if I go to keyboard then theres just htis picture of a mouse holding a 404 sign, and bunch of "unkown" buttons on the right.
If I go to the mouse instead and do some change, like change DPI and press apply. Exactly the same error message

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

Ok wait I found something.. If I dont touch the update rate, basically change it from 500hz to 1000hz then I can change DPI and hit save.
I get:
ratbag error: hidpp20: failed to update report rate

@FFY00
Copy link
Member

FFY00 commented Mar 22, 2020

Okay, that is expected. There's no image for your keyboard so we show the default one. The buttons show unknown because we don't have the symbols for those key codes (keyboard support is quite recent).

The easiest thing right now would be adding the key codes.

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

Can I give you some codes or something for this keyboard so you know how to fix it in future release?
How do I add the "key codes" ?
Also why do you think I cant put 1000hz without it crashing?

@GitJamz
Copy link

GitJamz commented Mar 22, 2020

yeah also changing some bind for the mouse fails:
ratbag error: hidpp20: failed to update button
ratbagd error: error committing device (-1000)

@GitJamz
Copy link

GitJamz commented Mar 27, 2020

Wait a minute..
Maybe the Mx Master series does not support 500hz pollingrate ... Maybe this is the problem..

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

No branches or pull requests

4 participants