Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/wsconsctl Allow standalone commands to be recognized, a...
details: https://anonhg.NetBSD.org/src/rev/3a63a4ec4c15
branches: trunk
changeset: 759140:3a63a4ec4c15
user: phx <phx%NetBSD.org@localhost>
date: Tue Nov 30 12:22:06 2010 +0000
description:
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
diffstat:
sbin/wsconsctl/map_parse.y | 11 ++++++++---
sbin/wsconsctl/map_scan.l | 6 +++++-
2 files changed, 13 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r 4a7f9ddcf3cb -r 3a63a4ec4c15 sbin/wsconsctl/map_parse.y
--- a/sbin/wsconsctl/map_parse.y Tue Nov 30 11:35:30 2010 +0000
+++ b/sbin/wsconsctl/map_parse.y Tue Nov 30 12:22:06 2010 +0000
@@ -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];
diff -r 4a7f9ddcf3cb -r 3a63a4ec4c15 sbin/wsconsctl/map_scan.l
--- a/sbin/wsconsctl/map_scan.l Tue Nov 30 11:35:30 2010 +0000
+++ b/sbin/wsconsctl/map_scan.l Tue Nov 30 12:22:06 2010 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index