summaryrefslogtreecommitdiff
path: root/src/udev/keymap
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/keymap')
-rw-r--r--src/udev/keymap/95-keyboard-force-release.rules4
-rw-r--r--src/udev/keymap/95-keymap.rules7
-rw-r--r--src/udev/keymap/README.keymap.txt4
-rw-r--r--src/udev/keymap/keymap.c51
4 files changed, 34 insertions, 32 deletions
diff --git a/src/udev/keymap/95-keyboard-force-release.rules b/src/udev/keymap/95-keyboard-force-release.rules
index 405bf92f26..f97a022d8d 100644
--- a/src/udev/keymap/95-keyboard-force-release.rules
+++ b/src/udev/keymap/95-keyboard-force-release.rules
@@ -19,13 +19,13 @@ DRIVER!="atkbd", GOTO="force_release_end"
ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keyboard-force-release.sh $devpath samsung-other"
-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*", RUN+="keyboard-force-release.sh $devpath samsung-90x3a"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*|*900X3*|*900X4*", RUN+="keyboard-force-release.sh $devpath samsung-series-9"
ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Latitude E*|Latitude *U|Precision M*", RUN+="keyboard-force-release.sh $devpath dell-touchpad"
ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="XPS*", RUN+="keyboard-force-release.sh $devpath dell-xps"
-ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u|AMILO Xi 2428", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO*", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
ENV{DMI_VENDOR}=="FOXCONN", ATTR{[dmi/id]product_name}=="QBOOK", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
diff --git a/src/udev/keymap/95-keymap.rules b/src/udev/keymap/95-keymap.rules
index 2dae13bcc1..347b5a1dda 100644
--- a/src/udev/keymap/95-keymap.rules
+++ b/src/udev/keymap/95-keymap.rules
@@ -59,8 +59,9 @@ ENV{DMI_VENDOR}=="MICRO-STAR*|Micro-Star*", KERNELS=="input*", ATTRS{name}=="MSI
# Older Vaios have some different keys
ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old"
-# Some Sony VGN models have yet another one
+# Some Sony VGN/VPC models have yet another one
ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="VGN-AR71*|VGN-FW*|VGN-Z21*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-vgn"
+ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="VPC*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-vpc"
#
@@ -96,6 +97,7 @@ ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*",
ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*", RUN+="keymap $name hewlett-packard-presario-2100"
ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP G62 Notebook PC", RUN+="keymap $name 0xB2 www"
ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP ProBook*", RUN+="keymap $name 0xF8 rfkill"
+ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP EliteBook 8440p", RUN+="keymap $name hewlett-packard_elitebook-8440p"
# HP Pavillion dv6315ea has empty DMI_VENDOR
ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play
@@ -146,7 +148,8 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keymap $name samsung-oth
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us"
ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*700Z*", RUN+="keymap $name 0xBA ejectcd 0x96 keyboardbrightnessup 0x97 keyboardbrightnessdown"
-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*", RUN+="keymap $name samsung-90x3a"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*700T*", RUN+="keymap $name 0xAD leftmeta"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*90X3A*|*900X3*|*900X4*", RUN+="keymap $name samsung-series-9"
ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100"
ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite A110", RUN+="keymap $name toshiba-satellite_a110"
diff --git a/src/udev/keymap/README.keymap.txt b/src/udev/keymap/README.keymap.txt
index 52d50ed2de..2cf2a4e88c 100644
--- a/src/udev/keymap/README.keymap.txt
+++ b/src/udev/keymap/README.keymap.txt
@@ -33,10 +33,6 @@ udev-keymap consists of the following parts:
findkeyboards:: display evdev input devices which belong to actual keyboards,
i. e. those suitable for the keymap program
- fdi2rules.py:: convert hal keymap FDIs into udev rules and key map files
- (Please note that this is far from perfect, since the mapping between fdi and
- udev rules is not straightforward, and impossible in some cases.)
-
== Fixing broken keys ==
In order to make a broken key work on your system and send it back to upstream
diff --git a/src/udev/keymap/keymap.c b/src/udev/keymap/keymap.c
index 6dc9c2d200..27aaf6b670 100644
--- a/src/udev/keymap/keymap.c
+++ b/src/udev/keymap/keymap.c
@@ -7,19 +7,19 @@
* Copyright (C) 2006, Lennart Poettering
* Copyright (C) 2009, Canonical Ltd.
*
- * keymap is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * keymap is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with keymap; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
@@ -62,28 +62,28 @@ static int evdev_open(const char *dev)
return fd;
}
-static int evdev_get_keycode(int fd, int scancode, int e)
+static int evdev_get_keycode(int fd, unsigned scancode, int e)
{
- int codes[2];
+ unsigned codes[2];
codes[0] = scancode;
if (ioctl(fd, EVIOCGKEYCODE, codes) < 0) {
if (e && errno == EINVAL) {
return -2;
} else {
- fprintf(stderr, "EVIOCGKEYCODE: %m\n");
+ fprintf(stderr, "EVIOCGKEYCODE for scan code 0x%x: %m\n", scancode);
return -1;
}
}
return codes[1];
}
-static int evdev_set_keycode(int fd, int scancode, int keycode)
+static int evdev_set_keycode(int fd, unsigned scancode, int keycode)
{
- int codes[2];
+ unsigned codes[2];
codes[0] = scancode;
- codes[1] = keycode;
+ codes[1] = (unsigned) keycode;
if (ioctl(fd, EVIOCSKEYCODE, codes) < 0) {
fprintf(stderr, "EVIOCSKEYCODE: %m\n");
@@ -128,7 +128,8 @@ static const char* format_keyname(const char* key) {
static int dump_table(int fd) {
char version[256], name[256];
- int scancode, r = -1;
+ unsigned scancode;
+ int r = -1;
if (evdev_driver_version(fd, version, sizeof(version)) < 0)
goto fail;
@@ -192,7 +193,8 @@ static int merge_table(int fd, FILE *f) {
while (!feof(f)) {
char s[256], *p;
- int scancode, new_keycode, old_keycode;
+ unsigned scancode;
+ int new_keycode, old_keycode;
if (!fgets(s, sizeof(s), f))
break;
@@ -224,19 +226,19 @@ static int merge_table(int fd, FILE *f) {
if ((old_keycode = evdev_get_keycode(fd, scancode, 0)) < 0) {
r = -1;
- goto fail;
+ continue;
}
if (evdev_set_keycode(fd, scancode, new_keycode) < 0) {
r = -1;
- goto fail;
+ continue;
}
if (new_keycode != old_keycode)
fprintf(stderr, "Remapped scancode 0x%02x to 0x%02x (prior: 0x%02x)\n",
scancode, new_keycode, old_keycode);
}
-fail:
+
fclose(f);
return r;
}
@@ -260,7 +262,7 @@ static int read_event(int fd, struct input_event* ev)
return 1;
}
-static void print_key(uint32_t scancode, uint16_t keycode, int has_scan, int has_key)
+static void print_key(unsigned scancode, uint16_t keycode, int has_scan, int has_key)
{
const char *keyname;
@@ -289,7 +291,7 @@ static void print_key(uint32_t scancode, uint16_t keycode, int has_scan, int has
static void interactive(int fd)
{
struct input_event ev;
- uint32_t last_scan = 0;
+ unsigned last_scan = 0;
uint16_t last_key = 0;
int has_scan; /* boolean */
int has_key; /* 0: none, 1: release, 2: press */
@@ -421,12 +423,13 @@ int main(int argc, char **argv)
/* Open override file if present, otherwise default file */
char keymap_path[PATH_MAX];
FILE *f;
- snprintf(keymap_path, sizeof(keymap_path), "%s%s", SYSCONFDIR "/udev/keymaps/", filearg);
+
+ snprintf(keymap_path, sizeof(keymap_path), "/etc/udev/keymaps/%s", filearg);
f = fopen(keymap_path, "re");
if (f) {
merge_table(fd, f);
} else {
- snprintf(keymap_path, sizeof(keymap_path), "%s%s", UDEVLIBEXECDIR "/keymaps/", filearg);
+ snprintf(keymap_path, sizeof(keymap_path), UDEVLIBEXECDIR "/keymaps/%s", filearg);
f = fopen(keymap_path, "re");
if (f)
merge_table(fd, f);