[tyndur-devel] [PATCH 3/3] vterm: Tastaturbelegungen de und us
Kevin Wolf ·
* vterm: Deutsche Tastaturbelegung auslagern und in system/keymaps verfuegbar machen, aber weiterhin als Default dazulinken. + vterm: Amerikanische Tastaturbelegung. Nur kompilieren und nach system/keymaps kopieren. Signed-off-by: Kevin Wolf <kevin at tyndur.org> --- src/modules/vterm/Makefile.all | 2 +- src/modules/vterm/include/keymap.h | 2 + src/modules/vterm/keymap.c | 131 ------------------------- src/modules/vterm/keymaps/Makefile.all | 10 ++ src/modules/vterm/keymaps/de.c | 167 ++++++++++++++++++++++++++++++++ src/modules/vterm/keymaps/us.c | 167 ++++++++++++++++++++++++++++++++ 6 files changed, 347 insertions(+), 132 deletions(-) create mode 100644 src/modules/vterm/keymaps/Makefile.all create mode 100644 src/modules/vterm/keymaps/de.c create mode 100644 src/modules/vterm/keymaps/us.c diff --git a/src/modules/vterm/Makefile.all b/src/modules/vterm/Makefile.all index 7b9fe63..a987d5c 100644 --- a/src/modules/vterm/Makefile.all +++ b/src/modules/vterm/Makefile.all @@ -2,5 +2,5 @@ shopt -s extglob source $LOST_BUILDMK_ROOT/config.sh echo "LD $1/modules/vterm" -$LOST_TOOLS_LD -Ttext=0x40000000 -ovterm.mod *.o --start-group $2 --end-group +$LOST_TOOLS_LD -Ttext=0x40000000 -ovterm.mod *.o keymaps/de.o --start-group $2 --end-group $LOST_TOOLS_STRIP -s vterm.mod -o $1/modules/vterm diff --git a/src/modules/vterm/include/keymap.h b/src/modules/vterm/include/keymap.h index dcbc0ba..4a8a733 100644 --- a/src/modules/vterm/include/keymap.h +++ b/src/modules/vterm/include/keymap.h @@ -49,6 +49,8 @@ typedef struct keymap_entry { wchar_t ctrl; } keymap_entry_t; +extern keymap_entry_t keymap[128]; + /** * Eintrag aus der Keymap auslesen * diff --git a/src/modules/vterm/keymap.c b/src/modules/vterm/keymap.c index c1881bd..48cd340 100644 --- a/src/modules/vterm/keymap.c +++ b/src/modules/vterm/keymap.c @@ -39,137 +39,6 @@ #include "vterm.h" #include "keymap.h" -keymap_entry_t keymap[] = { - { 0, 0, 0, 0 }, // 0 - { '\033', '\033', '\033', '\033' }, - { '1', '!', '|', 0 }, - { '2', '"', 0, 0 }, - { '3', '#', 0, 0 }, - { '4', '$', 0, 0 }, - { '5', '%', 0, 0 }, - { '6', '&', 0, 0 }, - { '7', '/', '{', 0 }, - { '8', '(', '[', 0 }, - { '9', ')', ']', 0 }, // 10 - { '0', '=', '}', 0 }, - {L'Ã', '?', '\\', 0 }, - { 0, '`', 0, 0 }, - { '\b', 0, 0, 0 }, - { '\t', 0, 0, 0 }, - { 'q', 'Q', '@', 17 }, - { 'w', 'W', 0, 23 }, - { 'e', 'E', 0, 5 }, - { 'r', 'R', 0, 18 }, - { 't', 'T', 0, 20 }, // 20 - { 'z', 'Z', 0, 26 }, - { 'u', 'U', 0, 21 }, - { 'i', 'I', 0, 9 }, - { 'o', 'O', 0, 15 }, - { 'p', 'P', 0, 16 }, - {L'ü', L'Ã', 0, 0 }, - { '+', '*', '~', 0 }, - { '\n', 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 'a', 'A', 0, 1 }, // 30 - { 's', 'S', 0, 19 }, - { 'd', 'D', 0, 4 }, - { 'f', 'F', 0, 6 }, - { 'g', 'G', 0, 7 }, - { 'h', 'H', 0, 8 }, - { 'j', 'J', 0, 10 }, - { 'k', 'K', 0, 11 }, - { 'l', 'L', 0, 12 }, - {L'ö', L'Ã', 0, 0 }, - {L'ä', L'Ã', 0, 0 }, // 40 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { '#', '\'', 0, 0 }, - { 'y', 'Y', 0, 25 }, - { 'x', 'X', 0, 24 }, - { 'c', 'C', 0, 3 }, - { 'v', 'V', 0, 22 }, - { 'b', 'B', 0, 2 }, - { 'n', 'N', 0, 14 }, - { 'm', 'M', 0, 13 }, // 50 - { ',', ';', 0, 0 }, - { '.', ':', 0, 0 }, - { '-', '_', 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { ' ', ' ', ' ', 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 60 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 70 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 80 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { '<', '>', '|', 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 90 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 100 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 110 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, // 120 - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, -}; - /** * Eintrag aus der Keymap auslesen * diff --git a/src/modules/vterm/keymaps/Makefile.all b/src/modules/vterm/keymaps/Makefile.all new file mode 100644 index 0000000..b0efe9a --- /dev/null +++ b/src/modules/vterm/keymaps/Makefile.all @@ -0,0 +1,10 @@ +shopt -s extglob +source $LOST_BUILDMK_ROOT/config.sh + +mkdir -p $1/system/keymaps + +for lang in de us; do + echo "KMAP $lang" + $LOST_TOOLS_LD --oformat binary $lang.o -e 0 -o $1/system/keymaps/$lang.kbd + chmod a-x $1/system/keymaps/$lang.kbd +done diff --git a/src/modules/vterm/keymaps/de.c b/src/modules/vterm/keymaps/de.c new file mode 100644 index 0000000..df400bd --- /dev/null +++ b/src/modules/vterm/keymaps/de.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2008 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Antoine Kaufmann. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the tyndur Project + * and its contributors. + * 4. Neither the name of the tyndur Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "keymap.h" + +keymap_entry_t keymap[128] = { + { 0, 0, 0, 0 }, // 0 + { '\033', '\033', '\033', '\033' }, + { '1', '!', '|', 0 }, + { '2', '"', 0, 0 }, + { '3', '#', 0, 0 }, + { '4', '$', 0, 0 }, + { '5', '%', 0, 0 }, + { '6', '&', 0, 0 }, + { '7', '/', '{', 0 }, + { '8', '(', '[', 0 }, + { '9', ')', ']', 0 }, // 10 + { '0', '=', '}', 0 }, + {L'Ã', '?', '\\', 0 }, + { 0, '`', 0, 0 }, + { '\b', 0, 0, 0 }, + { '\t', 0, 0, 0 }, + { 'q', 'Q', '@', 17 }, + { 'w', 'W', 0, 23 }, + { 'e', 'E', 0, 5 }, + { 'r', 'R', 0, 18 }, + { 't', 'T', 0, 20 }, // 20 + { 'z', 'Z', 0, 26 }, + { 'u', 'U', 0, 21 }, + { 'i', 'I', 0, 9 }, + { 'o', 'O', 0, 15 }, + { 'p', 'P', 0, 16 }, + {L'ü', L'Ã', 0, 0 }, + { '+', '*', '~', 0 }, + { '\n', 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 'a', 'A', 0, 1 }, // 30 + { 's', 'S', 0, 19 }, + { 'd', 'D', 0, 4 }, + { 'f', 'F', 0, 6 }, + { 'g', 'G', 0, 7 }, + { 'h', 'H', 0, 8 }, + { 'j', 'J', 0, 10 }, + { 'k', 'K', 0, 11 }, + { 'l', 'L', 0, 12 }, + {L'ö', L'Ã', 0, 0 }, + {L'ä', L'Ã', 0, 0 }, // 40 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { '#', '\'', 0, 0 }, + { 'y', 'Y', 0, 25 }, + { 'x', 'X', 0, 24 }, + { 'c', 'C', 0, 3 }, + { 'v', 'V', 0, 22 }, + { 'b', 'B', 0, 2 }, + { 'n', 'N', 0, 14 }, + { 'm', 'M', 0, 13 }, // 50 + { ',', ';', 0, 0 }, + { '.', ':', 0, 0 }, + { '-', '_', 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { ' ', ' ', ' ', 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 60 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 70 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 80 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { '<', '>', '|', 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 90 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 100 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 110 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 120 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, +}; diff --git a/src/modules/vterm/keymaps/us.c b/src/modules/vterm/keymaps/us.c new file mode 100644 index 0000000..783268e --- /dev/null +++ b/src/modules/vterm/keymaps/us.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2008 The tyndur Project. All rights reserved. + * + * This code is derived from software contributed to the tyndur Project + * by Antoine Kaufmann. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the tyndur Project + * and its contributors. + * 4. Neither the name of the tyndur Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "keymap.h" + +keymap_entry_t keymap[128] = { + { 0, 0, 0, 0 }, // 0 + { '\033', '\033', '\033', '\033' }, + { '1', '!', '|', 0 }, + { '2', '@', 0, 0 }, + { '3', '#', 0, 0 }, + { '4', '$', 0, 0 }, + { '5', '%', 0, 0 }, + { '6', '^', 0, 0 }, + { '7', '&', 0, 0 }, + { '8', '*', 0, 0 }, + { '9', '(', 0, 0 }, // 10 + { '0', ')', 0, 0 }, + { '-', '_', 0, 0 }, + { '=', '+', 0, 0 }, + { '\b', 0, 0, 0 }, + { '\t', 0, 0, 0 }, + { 'q', 'Q', '@', 17 }, + { 'w', 'W', 0, 23 }, + { 'e', 'E', 0, 5 }, + { 'r', 'R', 0, 18 }, + { 't', 'T', 0, 20 }, // 20 + { 'y', 'Y', 0, 26 }, + { 'u', 'U', L'ü', 21 }, + { 'i', 'I', 0, 9 }, + { 'o', 'O', L'ö', 15 }, + { 'p', 'P', 0, 16 }, + { '[', '{', 0, 0 }, + { ']', '}', 0, 0 }, + { '\n', 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 'a', 'A', L'ä', 1 }, // 30 + { 's', 'S', L'Ã', 19 }, + { 'd', 'D', 0, 4 }, + { 'f', 'F', 0, 6 }, + { 'g', 'G', 0, 7 }, + { 'h', 'H', 0, 8 }, + { 'j', 'J', 0, 10 }, + { 'k', 'K', 0, 11 }, + { 'l', 'L', 0, 12 }, + { ';', ':', 0, 0 }, + { '\'', '"', 0, 0 }, // 40 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { '\\', '|', 0, 0 }, + { 'z', 'Z', 0, 25 }, + { 'x', 'X', 0, 24 }, + { 'c', 'C', 0, 3 }, + { 'v', 'V', 0, 22 }, + { 'b', 'B', 0, 2 }, + { 'n', 'N', 0, 14 }, + { 'm', 'M', 0, 13 }, // 50 + { ',', '<', 0, 0 }, + { '.', '>', 0, 0 }, + { '/', '?', 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { ' ', ' ', ' ', 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 60 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 70 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 80 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { '<', '>', '|', 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 90 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 100 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 110 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, // 120 + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, +}; -- 1.6.0.2
Antworten
- [tyndur-devel] [PATCH 3/3] vterm: Tastaturbelegungen de und us · Antoine Kaufmann