Skip to contentSkip to conversation

Fix braille keyboard keysym generation

PATCH In review Samuel Thibault 2 participants 3 messages Nov 17, 2009 – Nov 20, 2009 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix braille keyboard keysym generation

Keysyms stored in key_map[] are not simply K() values, but U(K()) values, as can be seen in the KDSKBENT ioctl handler. The kernel-generated braille keysyms thus need a U() call too.

drivers/char/keyboard.c +1 -1
index 737be95..82c493e 100644
@@ -1249,7 +1249,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
 
 	if (keycode >= NR_KEYS)
 		if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8)
-			keysym = K(KT_BRL, keycode - KEY_BRL_DOT1 + 1);
+			keysym = U(K(KT_BRL, keycode - KEY_BRL_DOT1 + 1));
 		else
 			return;
 	else
#1 lore raw
Quoted 11 lines · On Tue, 17 Nov 2009 14:51:11 +0100 Samuel Thibault…

Keysyms stored in key_map[] are not simply K() values, but U(K()) values, as can be seen in the KDSKBENT ioctl handler. The kernel-generated braille keysyms thus need a U() call too.

drivers/char/keyboard.c +0 -0
index 737be95..82c493e 100644

drivers/char/keyboard.c static void kbd_keycode(unsigned int keycode, int down, int hw_raw) · line 1255

Quoted 8 lines
drivers/char/keyboard.c +1 -1
@@ -1249,7 +1249,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
 
 	if (keycode >= NR_KEYS)
 		if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8)
-			keysym = K(KT_BRL, keycode - KEY_BRL_DOT1 + 1);
+			keysym = U(K(KT_BRL, keycode - KEY_BRL_DOT1 + 1));
 		else
 			return;
 	else

Sorry, but I cannot work out (with a reasonable amount of effort) what the user-visible effects of this bug are likely to be. So I am not in a position to decide which kernel(s) this patch should be merged into.

Please be careful to include this aspect in the changelog when appropriate, thanks.

#2 lore raw
Quoted 11 lines · Andrew Morton, le Fri 20 Nov 2009 13:19:54 -0800, a écrit :

drivers/char/keyboard.c static void kbd_keycode(unsigned int keycode, int down, int hw_raw) · line 1255

Quoted 7 lines
drivers/char/keyboard.c +1 -1
 	if (keycode >= NR_KEYS)
 		if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8)
-			keysym = K(KT_BRL, keycode - KEY_BRL_DOT1 + 1);
+			keysym = U(K(KT_BRL, keycode - KEY_BRL_DOT1 + 1));
 		else
 			return;
 	else

Sorry, but I cannot work out (with a reasonable amount of effort) what the user-visible effects of this bug are likely to be. So I am not in a position to decide which kernel(s) this patch should be merged into.

It will make braille keyboards actually work. Apparently I had never really tried it and so it has never worked up to now.

Quoted 2 lines

Please be careful to include this aspect in the changelog when appropriate, thanks.

Right, sorry. Braille keyboards announced as KEY_BRL_DOT* are still pretty rare (that's why the bug completely went unnoticed from the start), so it's maybe not worth including the patch in the stable kernels, but making it for 2.6.32 would be a good thing.

Samuel