From 9bdc18da391979479ad5c677770c3e8dffa1cb9a Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 20 Sep 2009 15:06:07 +0200 Subject: Keymaps are now loaded from ramfs. --- Source/Kernel/Ressources/Keymaps/Keymap.h | 9 ++++++++ Source/Kernel/Ressources/Keymaps/MakeMKM.sh | 18 +++++++++++++++ Source/Kernel/Ressources/Keymaps/WriteKeymap.cpp | 27 +++++++++++++++++++++++ Source/Kernel/Ressources/Keymaps/fr.cxd | 2 ++ Source/Kernel/Ressources/Keymaps/fr.mkm | Bin 0 -> 2560 bytes 5 files changed, 56 insertions(+) create mode 100644 Source/Kernel/Ressources/Keymaps/Keymap.h create mode 100755 Source/Kernel/Ressources/Keymaps/MakeMKM.sh create mode 100644 Source/Kernel/Ressources/Keymaps/WriteKeymap.cpp create mode 100644 Source/Kernel/Ressources/Keymaps/fr.mkm (limited to 'Source/Kernel/Ressources/Keymaps') diff --git a/Source/Kernel/Ressources/Keymaps/Keymap.h b/Source/Kernel/Ressources/Keymaps/Keymap.h new file mode 100644 index 0000000..304e52c --- /dev/null +++ b/Source/Kernel/Ressources/Keymaps/Keymap.h @@ -0,0 +1,9 @@ +#include + +struct melon_keymap_t { + WChar normal[128]; + WChar shift[128]; + WChar caps[128]; + WChar altgr[128]; + WChar shiftaltgr[128]; +}; diff --git a/Source/Kernel/Ressources/Keymaps/MakeMKM.sh b/Source/Kernel/Ressources/Keymaps/MakeMKM.sh new file mode 100755 index 0000000..ac54ce8 --- /dev/null +++ b/Source/Kernel/Ressources/Keymaps/MakeMKM.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +#DIR=`pwd` +#DIR=`dirname $DIR` +#cd $DIR + +for KM in `ls | grep cxd`; do + echo "#define THIS_IS_NOT_MELON" > kmtemp.cpp + echo "#include " >> kmtemp.cpp + echo "#include " >> kmtemp.cpp + echo "#include \"$KM\"" >> kmtemp.cpp + cat WriteKeymap.cpp >> kmtemp.cpp + + g++ kmtemp.cpp -o kmtemp -I ../.. + ./kmtemp +done + +rm kmtemp* diff --git a/Source/Kernel/Ressources/Keymaps/WriteKeymap.cpp b/Source/Kernel/Ressources/Keymaps/WriteKeymap.cpp new file mode 100644 index 0000000..c3aa61c --- /dev/null +++ b/Source/Kernel/Ressources/Keymaps/WriteKeymap.cpp @@ -0,0 +1,27 @@ +/* #define THIS_IS_NOT_MELON +#include +#include +#include "fr.cxd" */ +#include "Keymap.h" +#include +#include + +using namespace std; + +int main() { + melon_keymap_t km; + memcpy(km.normal, keymap_normal, 128 * sizeof(WChar)); + memcpy(km.shift, keymap_shift, 128 * sizeof(WChar)); + memcpy(km.caps, keymap_caps, 128 * sizeof(WChar)); + memcpy(km.altgr, keymap_altgr, 128 * sizeof(WChar)); + memcpy(km.shiftaltgr, keymap_shiftaltgr, 128 * sizeof(WChar)); + + string a = LANG; + a += ".mkm"; + + fstream output(a.c_str(), ios::out | ios::binary); + output.write((char*)&km, sizeof(km)); + output.close(); + + return 0; +} diff --git a/Source/Kernel/Ressources/Keymaps/fr.cxd b/Source/Kernel/Ressources/Keymaps/fr.cxd index 8cfdf8c..d2d9ead 100644 --- a/Source/Kernel/Ressources/Keymaps/fr.cxd +++ b/Source/Kernel/Ressources/Keymaps/fr.cxd @@ -1,3 +1,5 @@ +#define LANG "fr" + //This file is precious !!! Very precious !! WChar keymap_normal[128] = { diff --git a/Source/Kernel/Ressources/Keymaps/fr.mkm b/Source/Kernel/Ressources/Keymaps/fr.mkm new file mode 100644 index 0000000..94c72ec Binary files /dev/null and b/Source/Kernel/Ressources/Keymaps/fr.mkm differ -- cgit v1.2.3