Bug 5379

Summary: [PATCH] unable to define multimedia keys for laptops
Product: [Development] Sisyphus Reporter: cat <akotv@mail.ru>
Component: kbdAssignee: Alexey Gladkov <legion@altlinux.org>
Status: CLOSED FIXED QA Contact: qa-sisyphus@altlinux.org
Severity: enhancement    
Priority: P5 CC: mike@altlinux.org
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
console-tools-setkeycodes-bound.patch none

Description From 2004-10-21 23:57:36
When I use setkeycodes command with the goal to define multimedia keys given
utility complains about keycode bound violation. As far as I know ioctl data
type for scancode is an int thus it should be possible to add keycodes which are
bigger than one byte length (it is feasible at least for 2.6 kernel). The
solution can be as following (it works for me on compaq evo n410c):

--- console-tools-0.2.3/kbdtools/setkeycodes.c.orig     2004-10-21 20:37:08 +0300
+++ console-tools-0.2.3/kbdtools/setkeycodes.c  2004-10-21 20:38:25 +0300
@@ -75,7 +75,7 @@
          a.scancode -= 0xe000;
          a.scancode += 128;
        }
-      if (a.scancode > 255 || a.keycode > 127)
+      if (a.scancode > 255 || a.keycode > 255)
        badusage(_("code outside bounds"));
       if (ioctl(fd,KDSETKEYCODE,&a)) 
        {

Steps to Reproduce:
1. setkeycodes e023 163
2.
3.
Actual Results:  
[root@pc219b root]# setkeycodes e023 163
setkeycodes: code outside bounds
Usage: setkeycodes [options] scancode keycode ...
 (where scancode is either xx or e0xx, given in hexadecimal,
  and keycode is given in decimal)
valid options are:
        -h --help         display this help text and exit
        -V --version      display version information and exit

Expected Results:  
no output on success
------- Comment #1 From 2004-10-21 23:59:43 -------
Created an attachment (id=612) [details]
console-tools-setkeycodes-bound.patch
------- Comment #2 From 2007-11-10 23:30:24 -------
Пакет есть в 4.0/branch, но в Sisyphus уже orphaned.
------- Comment #3 From 2007-11-11 22:23:45 -------
Значит на его действующий аналог.
------- Comment #4 From 2007-11-28 16:07:19 -------
Для kbd 1.13 не актуально.