summaryrefslogtreecommitdiff
path: root/make_keycodes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'make_keycodes.sh')
-rwxr-xr-xmake_keycodes.sh52
1 files changed, 50 insertions, 2 deletions
diff --git a/make_keycodes.sh b/make_keycodes.sh
index 176c3aa9..d76d99fd 100755
--- a/make_keycodes.sh
+++ b/make_keycodes.sh
@@ -10,6 +10,20 @@ NEW_KEYCODES_NAME="tizen"
FULL_KEY_LIST="\/\/ For Tizen Keycodes"
CHANGE_STRING="\/\/ @For Tizen Keycodes@"
PLATFORM_BASE_KEYCODE=8
+RULE_FILE=${RULE_FILE_PATH}
+
+function generate_light_keycodes(){
+ echo "default xkb_keycodes \"evdev\" {" > ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo " minimum = 8;" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo " maximum = 255;" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo "" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo " // @For Tizen Keycodes@" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo "};" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo "" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo "xkb_keycodes "pc98" {" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo " include \"evdev(evdev)\"" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+ echo "};" >> ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+}
if [ -e ${KEYMAP_FILE_PATH} ]
then
@@ -20,14 +34,48 @@ else
fi
echo "Generate a tizen keycodes file"
+_light_keymap_mode=false
+_light_locale_mode=false
-cp ${KEYCODES_PATH}${DEFAULT_KEYCODES_NAME} ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+if [ -e ${RULE_FILE} ]
+then
+ while read STRING
+ do
+ if [[ $STRING == *"light_keymap="* ]]; then
+ _light_keymap_mode=${STRING#*=}
+ fi
+ if [[ $STRING == *"light_locale="* ]]; then
+ _light_locale_mode=${STRING#*=}
+ fi
+ done < ${RULE_FILE}
+fi
+echo "light keymap mode: "${_light_keymap_mode}", light locale mode: "${_light_locale_mode}
+
+if [ "${_light_keymap_mode}" == "true" ]; then
+ generate_light_keycodes
+else
+ cp ${KEYCODES_PATH}${DEFAULT_KEYCODES_NAME} ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
+fi
+
+LOCALE_PATH=${TZ_SYS_RO_SHARE}/X11/locale/
+LOCALE_LIGHT_PATH=${TZ_SYS_RO_SHARE}/X11/locale-light/
+
+if [ -e ${LOCALE_LIGHT_PATH} ]; then
+ if [ "${_light_locale_mode}" == "true" ]; then
+ rm -rf ${LOCALE_PATH}
+ mv ${LOCALE_LIGHT_PATH} ${LOCALE_PATH}
+ else
+ rm -rf ${LOCALE_LIGHT_PATH}
+ fi
+fi
echo ${KEYCODES_PATH}${NEW_KEYCODES_NAME}
while read KEYNAME KERNEL_KEYCODE KEYBOARD_OPTS
do
- [[ $KEYBOARD_OPTS == *"keyboard"* ]] && continue
+ if [ "${_light_keymap_mode}" == "false" ]; then
+ [[ $KEYBOARD_OPTS == *"keyboard"* ]] && continue
+ fi
KERNEL_KEYCODE=$(echo $KERNEL_KEYCODE $PLATFORM_BASE_KEYCODE | awk '{print $1 + $2}')
KEYCODE="${KERNEL_KEYCODE}"
FULL_KEY_LIST=${FULL_KEY_LIST}"\n\t<I${KEYCODE}>=${KEYCODE}; \/\/ ${KEYNAME}"