Module Name: src
Committed By: phx
Date: Tue Nov 30 12:22:07 UTC 2010
Modified Files:
src/sbin/wsconsctl: map_parse.y map_scan.l
Log Message:
Allow standalone commands to be recognized, as in the in-kernel keymaps.
Also allow the Cmd token. Examples:
keycode 210 = Cmd Cmd_BrightnessUp
keycode 211 = Cmd_VolumeToggle
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/wsconsctl/map_parse.y
cvs rdiff -u -r1.5 -r1.6 src/sbin/wsconsctl/map_scan.l
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/wsconsctl/map_parse.y
diff -u src/sbin/wsconsctl/map_parse.y:1.8 src/sbin/wsconsctl/map_parse.y:1.9
--- src/sbin/wsconsctl/map_parse.y:1.8 Mon Apr 6 12:35:20 2009
+++ src/sbin/wsconsctl/map_parse.y Tue Nov 30 12:22:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: map_parse.y,v 1.8 2009/04/06 12:35:20 lukem Exp $ */
+/* $NetBSD: map_parse.y,v 1.9 2010/11/30 12:22:06 phx Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
int ival;
}
-%token T_KEYSYM T_KEYCODE
+%token T_KEYSYM T_KEYCODE T_CMD
%token <kval> T_KEYSYM_VAR T_KEYSYM_CMD_VAR
%token <ival> T_NUMBER
@@ -147,9 +147,14 @@
| T_KEYSYM_CMD_VAR = {
cur_mp->command = $1;
}
+ | T_CMD T_KEYSYM_CMD_VAR = {
+ cur_mp->command = KS_Cmd;
+ cur_mp->group1[0] = $2;
+ }
;
-keysym_list : keysym_var = {
+keysym_list : /* empty */
+ | keysym_var = {
cur_mp->group1[0] = $1;
cur_mp->group1[1] = ksym_upcase(cur_mp->group1[0]);
cur_mp->group2[0] = cur_mp->group1[0];
Index: src/sbin/wsconsctl/map_scan.l
diff -u src/sbin/wsconsctl/map_scan.l:1.5 src/sbin/wsconsctl/map_scan.l:1.6
--- src/sbin/wsconsctl/map_scan.l:1.5 Wed Oct 28 19:43:56 2009
+++ src/sbin/wsconsctl/map_scan.l Tue Nov 30 12:22:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: map_scan.l,v 1.5 2009/10/28 19:43:56 christos Exp $ */
+/* $NetBSD: map_scan.l,v 1.6 2010/11/30 12:22:06 phx Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -70,6 +70,10 @@
return(T_KEYSYM);
}
+Cmd {
+ return(T_CMD);
+ }
+
[a-zA-Z][a-zA-Z0-9_]* {
int i;