From ea5797c0731203c09ec5fb7172e77eab2750f1a9 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 23 Nov 2013 00:50:15 +0100 Subject: [PATCH] kbdfs: add esc1+shift and esc1+ctrl pages (see sources kbmap-uk-weird patch) Add pages for esc1+shift and esc1+ctrl - some UK USB keyboards (Dell) and it seems some German ones: https://groups.google.com/forum/#!topic/comp.os.plan9/ycok6NTCWCg seem to generate an esc1 + code scancode combination for the pipe/backslash key. Seems like overkill to add two whole pages for just two keys, but there again RAM is cheap these days. Probably should take the changes across to omap/kbd.c (and by extension bcm/kbd.c) but the changes are trivial. --- sys/lib/kbmap/uk | 5 ++++ sys/src/cmd/aux/kbdfs/kbdfs.c | 50 ++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/sys/lib/kbmap/uk b/sys/lib/kbmap/uk index 96641c853..aa689b834 100644 --- a/sys/lib/kbmap/uk +++ b/sys/lib/kbmap/uk @@ -4,4 +4,9 @@ 1 4 '£ 1 40 '@ 0 86 '\ +4 86 ^\ 1 86 '| + +2 86 '\ +5 86 ^\ +6 86 '| diff --git a/sys/src/cmd/aux/kbdfs/kbdfs.c b/sys/src/cmd/aux/kbdfs/kbdfs.c index 8bbe77f75..f812b958f 100644 --- a/sys/src/cmd/aux/kbdfs/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs/kbdfs.c @@ -180,6 +180,46 @@ Rune kbtabesc1[Nscan] = [0x78] 0, Kup, 0, 0, 0, 0, 0, 0, }; +Rune kbtabshiftesc1[Nscan] = +{ +[0x00] 0, 0, 0, 0, 0, 0, 0, 0, +[0x08] 0, 0, 0, 0, 0, 0, 0, 0, +[0x10] 0, 0, 0, 0, 0, 0, 0, 0, +[0x18] 0, 0, 0, 0, 0, 0, 0, 0, +[0x20] 0, 0, 0, 0, 0, 0, 0, 0, +[0x28] 0, 0, 0, 0, 0, 0, 0, 0, +[0x30] 0, 0, 0, 0, 0, 0, 0, 0, +[0x38] 0, 0, 0, 0, 0, 0, 0, 0, +[0x40] 0, 0, 0, 0, 0, 0, 0, 0, +[0x48] Kup, 0, 0, 0, 0, 0, 0, 0, +[0x50] 0, 0, 0, 0, 0, 0, 0, 0, +[0x58] 0, 0, 0, 0, 0, 0, 0, 0, +[0x60] 0, 0, 0, 0, 0, 0, 0, 0, +[0x68] 0, 0, 0, 0, 0, 0, 0, 0, +[0x70] 0, 0, 0, 0, 0, 0, 0, 0, +[0x78] 0, Kup, 0, 0, 0, 0, 0, 0, +}; + +Rune kbtabctrlesc1[Nscan] = +{ +[0x00] 0, 0, 0, 0, 0, 0, 0, 0, +[0x08] 0, 0, 0, 0, 0, 0, 0, 0, +[0x10] 0, 0, 0, 0, 0, 0, 0, 0, +[0x18] 0, 0, 0, 0, 0, 0, 0, 0, +[0x20] 0, 0, 0, 0, 0, 0, 0, 0, +[0x28] 0, 0, 0, 0, 0, 0, 0, 0, +[0x30] 0, 0, 0, 0, 0, 0, 0, 0, +[0x38] 0, 0, 0, 0, 0, 0, 0, 0, +[0x40] 0, 0, 0, 0, 0, 0, 0, 0, +[0x48] Kup, 0, 0, 0, 0, 0, 0, 0, +[0x50] 0, 0, 0, 0, 0, 0, 0, 0, +[0x58] 0, 0, 0, 0, 0, 0, 0, 0, +[0x60] 0, 0, 0, 0, 0, 0, 0, 0, +[0x68] 0, 0, 0, 0, 0, 0, 0, 0, +[0x70] 0, 0, 0, 0, 0, 0, 0, 0, +[0x78] 0, Kup, 0, 0, 0, 0, 0, 0, +}; + Rune kbtabaltgr[Nscan] = { [0x00] 0, 0, 0, 0, 0, 0, 0, 0, @@ -251,7 +291,11 @@ kbdputsc(Scan *scan, int c) if(c >= Nscan) return; - if(scan->esc1) + if(scan->esc1 && scan->ctl) + key.r = kbtabctrlesc1[c]; + else if(scan->esc1 && scan->shift) + key.r = kbtabshiftesc1[c]; + else if(scan->esc1) key.r = kbtabesc1[c]; else if(scan->shift) key.r = kbtabshift[c]; @@ -823,6 +867,10 @@ kbmapent(int t, int sc) return &kbtabaltgr[sc]; case 4: return &kbtabctl[sc]; + case 5: + return &kbtabctrlesc1[sc]; + case 6: + return &kbtabshiftesc1[sc]; } }