From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:subject:date:message-id:x-mailer; bh=dA5GGhWCu9HeHUyPYfcPUQT/MZlMqPeMuBQ/z9Y4bdE=; b=V3w9Q6US538X9vLtzOwrbgMkT16eXB6gtdQ58rygGbND7Ati7PYgD78g5lRoyyGEHYWK51wSM0Z3NBP98I1cD5K7U478/3085ZCH2B55Y87m9+h+727AQM09L1ieHooM1ESC7TiK+k4FysV8FUwjvdj9KjrsSVfsoTLxyuHNyok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; b=o+g3Cp2yQy8qgRoVnmhrk2MQFX3QUqkcASenq+8DtYhHAqPpuutSLCg7a5gA+OSydsrZ9Prp/lFU6/8Qg/KHAbsCY6W8x4MtKHRl8f7pymkr2VYATFf8LVqlZySYyenvwpAf8yWastiWJ/yNvxXmt66mcQex6VienQfSW6dSzrM= From: Michael Schutte To: kbd@lists.altlinux.org Date: Sat, 5 Apr 2008 12:46:53 +0200 Message-Id: <1207392413-7136-1-git-send-email-m.schutte.jr@gmail.com> X-Mailer: git-send-email 1.5.4.4 Subject: [kbd] [PATCH] Understand the CapsShift modifiers X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2008 10:47:00 -0000 Archived-At: List-Archive: This patch adds support for the CapsShift_Lock and SCapsShift keysyms to dumpkeys and loadkeys, which are understood my Linux kernels since 2.6.24. Thanks to Samuel Thibault . Signed-off-by: Michael Schutte --- man/man5/keymaps.5 | 7 +++++-- src/analyze.l | 2 ++ src/dumpkeys.c | 3 ++- src/ksyms.c | 6 ++++-- src/loadkeys.y | 3 ++- src/modifiers.h | 1 + 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/man/man5/keymaps.5 b/man/man5/keymaps.5 index 29aadfe..1b28a29 100644 --- a/man/man5/keymaps.5 +++ b/man/man5/keymaps.5 @@ -99,9 +99,9 @@ in the map file. .LP Which of the actions bound to a given key is taken when it is pressed depends on what modifiers are in effect at that moment. -The keyboard driver supports 8 modifiers. These modifiers are labeled +The keyboard driver supports 9 modifiers. These modifiers are labeled (completely arbitrarily) Shift, AltGr, Control, Alt, ShiftL, ShiftR, -CtrlL and CtrlR. +CtrlL, CtrlR and CapsShift. Each of these modifiers has an associated weight of power of two according to the following table: .LP @@ -134,6 +134,9 @@ CtrlL .TP 24 CtrlR 128 +.TP 24 +CapsShift +256 .PD .RE .LP diff --git a/src/analyze.l b/src/analyze.l index f55c676..adb9474 100644 --- a/src/analyze.l +++ b/src/analyze.l @@ -48,6 +48,7 @@ ShiftL shiftl|ShiftL|SHIFTL ShiftR shiftr|ShiftR|SHIFTR CtrlL ctrll|CtrlL|CTRLL CtrlR ctrlr|CtrlR|CTRLR +CapsShift capsshift|Capsshift|CapsShift|CAPSSHIFT AltIsMeta [aA][lL][tT][-_][iI][sS][-_][mM][eE][tT][aA] Strings strings|Strings|STRINGS Compose compose|Compose|COMPOSE @@ -106,6 +107,7 @@ To to|To|TO {ShiftR} {return(SHIFTR);} {CtrlL} {return(CTRLL);} {CtrlR} {return(CTRLR);} +{CapsShift} {return(CAPSSHIFT);} {AltIsMeta} {return(ALT_IS_META);} {Strings} {return(STRINGS);} {Compose} {return(COMPOSE);} diff --git a/src/dumpkeys.c b/src/dumpkeys.c index b0a108d..73f913a 100644 --- a/src/dumpkeys.c +++ b/src/dumpkeys.c @@ -282,7 +282,8 @@ static struct { { "shiftl", KG_SHIFTL }, { "shiftr", KG_SHIFTR }, { "ctrll", KG_CTRLL }, - { "ctrlr", KG_CTRLR } + { "ctrlr", KG_CTRLR }, + { "capsshift", KG_CAPSSHIFT } }; static void diff --git a/src/ksyms.c b/src/ksyms.c index b58af59..a322f70 100644 --- a/src/ksyms.c +++ b/src/ksyms.c @@ -1482,7 +1482,8 @@ static const char *lock_syms[] = { "ShiftL_Lock", "ShiftR_Lock", "CtrlL_Lock", - "CtrlR_Lock" + "CtrlR_Lock", + "CapsShift_Lock" }; /* Keysyms whose KTYP is KT_SLOCK. */ @@ -1495,7 +1496,8 @@ static const char *sticky_syms[] = { "SShiftL", "SShiftR", "SCtrlL", - "SCtrlR" + "SCtrlR", + "SCapsShift" }; /* Keysyms whose KTYP is KT_BRL. */ diff --git a/src/loadkeys.y b/src/loadkeys.y index 5497130..179fd03 100644 --- a/src/loadkeys.y +++ b/src/loadkeys.y @@ -5,7 +5,7 @@ */ %token EOL NUMBER LITERAL CHARSET KEYMAPS KEYCODE EQUALS -%token PLAIN SHIFT CONTROL ALT ALTGR SHIFTL SHIFTR CTRLL CTRLR +%token PLAIN SHIFT CONTROL ALT ALTGR SHIFTL SHIFTR CTRLL CTRLR CAPSSHIFT %token COMMA DASH STRING STRLITERAL COMPOSE TO CCHAR ERROR PLUS %token UNUMBER ALT_IS_META STRINGS AS USUAL ON FOR @@ -186,6 +186,7 @@ modifier : SHIFT { mod |= M_SHIFT; } | SHIFTR { mod |= M_SHIFTR; } | CTRLL { mod |= M_CTRLL; } | CTRLR { mod |= M_CTRLR; } + | CAPSSHIFT { mod |= M_CAPSSHIFT; } ; fullline : KEYCODE NUMBER EQUALS rvalue0 EOL { diff --git a/src/modifiers.h b/src/modifiers.h index af44b33..19d58be 100644 --- a/src/modifiers.h +++ b/src/modifiers.h @@ -7,3 +7,4 @@ #define M_SHIFTR (1 << KG_SHIFTR) #define M_CTRLL (1 << KG_CTRLL) #define M_CTRLR (1 << KG_CTRLR) +#define M_CAPSSHIFT (1 << KG_CAPSSHIFT) -- 1.5.4.4