All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] fixing hidp keycodes
@ 2005-04-21 22:03 Guylhem Aznar
  2005-04-22 10:16 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Guylhem Aznar @ 2005-04-21 22:03 UTC (permalink / raw)
  To: bluez-devel

Hello

I'm trying to replace hidp keycodes for a dell axim bluetooth keyboard
with has conflicting keycodes with my zaurus internal keys.

I tried to change the keycodes in hidp/core.c - However looks like my
modifications are only half applied, certainly due to a stupid
mistake.

How could I easily syslog the keycode from hidp_keycodes[] array being
sent to the input layer ?

--=20
Bien =E0 vous - Best regards,
Guylhem P. Aznar

--=20
*@externe.net                                            http://externe.n=
et
P=E9rim=E9/Deprecated:    @oeil.qc.ca, @metalab.unc.edu, @ibiblio.org, @7=
un.org
GPG: 92EB37C1 DD11C9C9 20519D01 E8FA1B11 42975AF7 http://externe.net/pubk=
ey


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] fixing hidp keycodes
  2005-04-21 22:03 Guylhem Aznar
@ 2005-04-22 10:16 ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2005-04-22 10:16 UTC (permalink / raw)
  To: bluez-devel

Hi Guylhem,

> I'm trying to replace hidp keycodes for a dell axim bluetooth keyboard
> with has conflicting keycodes with my zaurus internal keys.
> 
> I tried to change the keycodes in hidp/core.c - However looks like my
> modifications are only half applied, certainly due to a stupid
> mistake.

do you applied the -mh patch? If yes, then you device may run in report
mode and thus hidp_keycodes[] is not used, because it is boot mode only.

> How could I easily syslog the keycode from hidp_keycodes[] array being
> sent to the input layer ?

Use things like printk() or BT_ERR().

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] fixing hidp keycodes
@ 2005-04-22 10:56 Guylhem Aznar
  2005-04-22 11:10 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Guylhem Aznar @ 2005-04-22 10:56 UTC (permalink / raw)
  To: bluez-devel

Hello

Yes I did apply mh patches. I can put a copy of the kernel online if
you want to see it.

I'm not sure I understand the "report mode". Pressing on a keyboard
key after hidd --connect make the key work in applications. It's not
simply reporting.

hidp_keycode is declared locally in core.c and never used elsewhere.
input_report_key seems to send hidp_keycode[keys[i]] to the input
layer. If I printk this, I only see 0.=20

What I want to do on my strange keyboard is :
swap tab and capslock
swap capslock and esc

So I swapped 15 and 58, then 58 and 1 in the hidp_keycodes, but this
only gets me multiple esc. However, replacing keycodes 65 and 66 by 0
which where incorrectly send when pressing on a special keyboard
modifier key worked, as did swapping keycode 30 and 125 (some library
has keycode 30=3Dmodfier hardcoded in, so I had to do a workaround and
remap the a key to 125 and change the keyboard map accordingly)

This suggest that my approach should work. I don't understand why it's
not working with tab/capslock/esc.

I'm puzzled. Any suggestion is welcome.

--=20
Bien =E0 vous - Best regards,
Guylhem P. Aznar

--=20
*@externe.net                                            http://externe.n=
et
P=E9rim=E9/Deprecated:    @oeil.qc.ca, @metalab.unc.edu, @ibiblio.org, @7=
un.org
GPG: 92EB37C1 DD11C9C9 20519D01 E8FA1B11 42975AF7 http://externe.net/pubk=
ey


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] fixing hidp keycodes
  2005-04-22 10:56 [Bluez-devel] fixing hidp keycodes Guylhem Aznar
@ 2005-04-22 11:10 ` Marcel Holtmann
  2005-05-05 20:32   ` Guylhem Aznar
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2005-04-22 11:10 UTC (permalink / raw)
  To: bluez-devel

Hi Guylhem,

> Yes I did apply mh patches. I can put a copy of the kernel online if
> you want to see it.
> 
> I'm not sure I understand the "report mode". Pressing on a keyboard
> key after hidd --connect make the key work in applications. It's not
> simply reporting.

a HID device can work in two modes, boot mode and report mode. The boot
mode is a limited mode with a predefined descriptor and thus it needs a
keycode mapping table. In report mode the HID parser decodes the HID
report according to his descriptor and then generates the keycode. In
the latter case the hidp_keycodes[] table is not used, but it is a boot
mode only thing.

> hidp_keycode is declared locally in core.c and never used elsewhere.
> input_report_key seems to send hidp_keycode[keys[i]] to the input
> layer. If I printk this, I only see 0. 
> 
> What I want to do on my strange keyboard is :
> swap tab and capslock
> swap capslock and esc
> 
> So I swapped 15 and 58, then 58 and 1 in the hidp_keycodes, but this
> only gets me multiple esc. However, replacing keycodes 65 and 66 by 0
> which where incorrectly send when pressing on a special keyboard
> modifier key worked, as did swapping keycode 30 and 125 (some library
> has keycode 30=modfier hardcoded in, so I had to do a workaround and
> remap the a key to 125 and change the keyboard map accordingly)
> 
> This suggest that my approach should work. I don't understand why it's
> not working with tab/capslock/esc.

To make this working in report mode, you must replace the HID descriptor
or tell hidd to use the boot mode only. Speaking of which, I just saw
that I never added support for pushing a device into boot mode. However
the --nosdp option should do the trick.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-devel] fixing hidp keycodes
  2005-04-22 11:10 ` Marcel Holtmann
@ 2005-05-05 20:32   ` Guylhem Aznar
  0 siblings, 0 replies; 5+ messages in thread
From: Guylhem Aznar @ 2005-05-05 20:32 UTC (permalink / raw)
  To: bluez-devel

On Friday, 22 April 2005 at 13:10:06 (+0200), Marcel Holtmann wrote:
> > This suggest that my approach should work. I don't understand why it'=
s
> > not working with tab/capslock/esc.
>=20
> To make this working in report mode, you must replace the HID descripto=
r
> or tell hidd to use the boot mode only. Speaking of which, I just saw
> that I never added support for pushing a device into boot mode. However
> the --nosdp option should do the trick.

It doesn't. Here's the table I'm using in
kernel/net/bluetooth/hidp/core.c :

static unsigned char hidp_keycode[256] =3D {
          0,  0,  0,  0, 125, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
         50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
          4,  5,  6,  7,  8,  9, 10, 11, 28, 58, 14,  1, 57, 12, 13, 26,
         27, 43, 43, 39, 40, 41, 51, 52, 53, 15, 59, 60, 61, 62, 63, 64,
          0,  0, 67, 68, 87, 67, 99, 70,119,110,102,104,111,107,109,106,
        105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
         72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
        191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
        115,114,  0,  0,  0,121,  0, 89, 93,124, 92, 94, 95,  0,  0,  0,
        122,123, 90, 91, 85,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
          0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
         29, 42, 56, 30, 97, 54,100,126,164,166,165,163,161,115,114,113,
        150,158,159,128,136,177,178,176,142,152,173,140
};

As you can see, 30/125 1/15/58 have been swapped, and 65/66 have been rem=
oved. (that's necessary).

Yet it doesn't work. I still even get 65 and 66. I'm using bluez 2.16 (ex=
cept sdptool - cf other message) with
the kernel patch. The kernel is on
http://externe.net/zaurus/kernel/sources/linux-2.4.18-rmk7-pxa3-20050501.=
tar.gz

I first though my ifdef were at fault. I removed everything- I only have =
this hidp_keycode now. Still doesn't work anyway.

Would you have a patch for hidd or a suggestion?

--=20
Bien =E0 vous - Best regards,
Guylhem P. Aznar

--=20
*@externe.net                                            http://externe.n=
et
P=E9rim=E9/Deprecated:    @oeil.qc.ca, @metalab.unc.edu, @ibiblio.org, @7=
un.org
GPG: 92EB37C1 DD11C9C9 20519D01 E8FA1B11 42975AF7 http://externe.net/pubk=
ey


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-05 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22 10:56 [Bluez-devel] fixing hidp keycodes Guylhem Aznar
2005-04-22 11:10 ` Marcel Holtmann
2005-05-05 20:32   ` Guylhem Aznar
  -- strict thread matches above, loose matches on Subject: below --
2005-04-21 22:03 Guylhem Aznar
2005-04-22 10:16 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.