diff options
author | Alexis211 <alexis211@gmail.com> | 2009-09-20 15:06:07 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-09-20 15:06:07 +0200 |
commit | 9bdc18da391979479ad5c677770c3e8dffa1cb9a (patch) | |
tree | 412f79bf1dcbc5ea11d8aff6d2b016dacab2de3c /Source/Kernel/Ressources/Keymaps | |
parent | af3ff7f8c80bb3953f261a602316f92ec662daa8 (diff) | |
download | Melon-9bdc18da391979479ad5c677770c3e8dffa1cb9a.tar.gz Melon-9bdc18da391979479ad5c677770c3e8dffa1cb9a.zip |
Keymaps are now loaded from ramfs.
Diffstat (limited to 'Source/Kernel/Ressources/Keymaps')
-rw-r--r-- | Source/Kernel/Ressources/Keymaps/Keymap.h | 9 | ||||
-rwxr-xr-x | Source/Kernel/Ressources/Keymaps/MakeMKM.sh | 18 | ||||
-rw-r--r-- | Source/Kernel/Ressources/Keymaps/WriteKeymap.cpp | 27 | ||||
-rw-r--r-- | Source/Kernel/Ressources/Keymaps/fr.cxd | 2 | ||||
-rw-r--r-- | Source/Kernel/Ressources/Keymaps/fr.mkm | bin | 0 -> 2560 bytes |
5 files changed, 56 insertions, 0 deletions
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 <Library/WChar.class.h> + +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 <cstring>" >> kmtemp.cpp + echo "#include <Library/WChar.class.cpp>" >> 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 <cstring> +#include <Library/WChar.class.cpp> +#include "fr.cxd" */ +#include "Keymap.h" +#include <fstream> +#include <string> + +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 Binary files differnew file mode 100644 index 0000000..94c72ec --- /dev/null +++ b/Source/Kernel/Ressources/Keymaps/fr.mkm |