On Thu, Nov 21, 2013 at 11:02:46AM +0100, Martin Pieuchot wrote:
> Hi Juan,
> 
> On 21/11/13(Thu) 03:01, Juan Francisco Cantero Hurtado wrote:
> > http://www.logitech.com/es-es/product/comfort-keyboard-k290?crid=26
> > http://i.imgur.com/ZV1GLDt.jpg
> > 
> > The keyboard has two annoying problems:
> > - usbhidctl doesn't work. The biggest problem for me.
> > - Linux and Windows has programs to swap the functionality of the
> >   function keys (F1,F2...) and the windows quick access keys.  In this
> >   keyboard, you need to push the FN key to use the traditional F keys
> >   (F1, F2...). The keyboard has an internal functionality to swap this
> >   annoying behavior, it only need to receive the correct message from
> >   the OS.
> > 
> > I'm really interested in the fix for usbhidctl/uhidaction but it would
> > nice if someone can adapt the linux programs to OpenBSD to swap the Fn
> > keys.
> >
> > [...]
> > uhidev0 at uhub3 port 2 configuration 1 interface 0 "Logitech USB Keyboard" 
> > rev 1.10/87.00 addr 2
> > uhidev0: iclass 3/1
> > ukbd0 at uhidev0: 8 variable keys, 6 key codes
> > wskbd1 at ukbd0 mux 1
> > uhidev1 at uhub3 port 2 configuration 1 interface 1 "Logitech USB Keyboard" 
> > rev 1.10/87.00 addr 2
> > uhidev1: iclass 3/0, 5 report ids
> > uhid0 at uhidev1 reportid 3: input=2, output=0, feature=0
> > uhid1 at uhidev1 reportid 4: input=1, output=0, feature=0
> > uhid2 at uhidev1 reportid 5: input=0, output=0, feature=5
> 
> It might be a bit confusing, but your keyboard is attached as two
> uhidev(4) devices.  Only the first one ``uhidev0'' is recognized as
> a keyboard.  Have you tried usbhidctl(1) on its node: /dev/wskbd1 ?

No. I always used "/dev/uhid1" with my last USB keyboard.

The output of usbhidctl with wskbd1:

Keyboard.Keyboard_LeftControl=0
Keyboard.Keyboard_LeftShift=0
Keyboard.Keyboard_LeftAlt=0
Keyboard.Keyboard_Left_GUI=0
Keyboard.Keyboard_RightControl=0
Keyboard.Keyboard_RightShift=0
Keyboard.Keyboard_RightAlt=0
Keyboard.Keyboard_Right_GUI=0
Keyboard.Num_Lock=0
Keyboard.Caps_Lock=0
Keyboard.Scroll_Lock=0
Keyboard.No_Event=1 [0]
Keyboard.No_Event=1 [1]
Keyboard.No_Event=1 [2]
Keyboard.No_Event=1 [3]
Keyboard.No_Event=1 [4]
Keyboard.No_Event=1 [5]


Report descriptor:
Collection page=Generic_Desktop usage=Keyboard
Input   size=1 count=1 page=Keyboard usage=Keyboard_LeftControl, logical range 
0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_LeftShift, logical range 
0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_LeftAlt, logical range 0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_Left_GUI, logical range 0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_RightControl, logical range 
0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_RightShift, logical range 
0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_RightAlt, logical range 0..1
Input   size=1 count=1 page=Keyboard usage=Keyboard_Right_GUI, logical range 
0..1
Output  size=1 count=1 page=LEDs usage=Num_Lock, logical range 0..1
Output  size=1 count=1 page=LEDs usage=Caps_Lock, logical range 0..1
Output  size=1 count=1 page=LEDs usage=Scroll_Lock, logical range 0..1
Input   size=8 count=6 Array page=Keyboard usage=No_Event..0x00ff, logical 
range 0..255
End collection
Total   input size 8 bytes
Total  output size 1 bytes
Total feature size 0 bytes

> 
> The code needed to swap the F keys is no really complicated to do and
> I guess you can do it.
> 
> The idea is to send a magic sequence to the device, there's a lot of
> code doing that in others drivers.  You can take a look at how ugold(4)
> issues its command or how ukbd(4) blinks its LEDs.

I'll take a look. Thanks!.

> 
> All you need to do is match your keyboard by vendor & product in
> ukbd_attach() and send the reversed engineered command that toggle the
> key swapping.  
> 
> Please don't hesitate to contact me if you need more help.

Probably I will.

-- 
Juan Francisco Cantero Hurtado http://juanfra.info

Reply via email to