diff options
author | jhyuni.kang <jhyuni.kang@samsung.com> | 2015-03-30 23:56:50 +0900 |
---|---|---|
committer | jhyuni.kang <jhyuni.kang@samsung.com> | 2015-04-06 14:39:09 +0900 |
commit | 253d5cfd0079f556a24b930bcac54cf637a8de31 (patch) | |
tree | b59e23eaf41360fe83ec630dd5ff7ff1f6c4245e /make_keycodes.sh | |
parent | dd022a059cdd0bebd806d58479c29999a7d91a2e (diff) | |
download | xkeyboard-config-253d5cfd0079f556a24b930bcac54cf637a8de31.tar.gz xkeyboard-config-253d5cfd0079f556a24b930bcac54cf637a8de31.tar.bz2 xkeyboard-config-253d5cfd0079f556a24b930bcac54cf637a8de31.zip |
Make a tizen keymap using a tizen key layout filesubmit/tizen/20150422.015927accepted/tizen/wearable/20150422.103018accepted/tizen/tv/20150422.102318accepted/tizen/mobile/20150422.103718accepted/tizen/common/20150423.073902
Diffstat (limited to 'make_keycodes.sh')
-rwxr-xr-x | make_keycodes.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/make_keycodes.sh b/make_keycodes.sh new file mode 100755 index 00000000..616854a9 --- /dev/null +++ b/make_keycodes.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +KEYMAP_FILE_PATH="/usr/share/X11/xkb/tizen_key_layout.txt" +KEYCODES_PATH="./keycodes/" +DEFAULT_KEYCODES_NAME="evdev" +NEW_KEYCODES_NAME="tizen_"${TIZEN_PROFILE} +FULL_KEY_LIST="\/\/ For Tizen Keycodes" +CHANGE_STRING="\/\/ @For Tizen Keycodes@" +PLATFORM_BASE_KEYCODE=8 + +if [ -e ${KEYMAP_FILE_PATH} ] +then + echo "${TIZEN_PROFILE} have a key layout file: ${KEYMAP_FILE_PATH}" +else + echo "${TIZEN_PROFILE} doesn't have a key layout file: ${KEYMAP_FILE_PATH}" + exit +fi + +echo "Generate a tizen keycodes file" + +cp ${KEYCODES_PATH}${DEFAULT_KEYCODES_NAME} ${KEYCODES_PATH}${NEW_KEYCODES_NAME} + +echo ${KEYCODES_PATH}${NEW_KEYCODES_NAME} + +while read KEYNAME KERNEL_KEYCODE +do + KERNEL_KEYCODE=$(echo $KERNEL_KEYCODE $PLATFORM_BASE_KEYCODE | awk '{print $1 + $2}') + KEYCODE="${KERNEL_KEYCODE}" + if [ "${TIZEN_WINDOW_SYSTEM}" = "x11" ] + then + FULL_KEY_LIST=${FULL_KEY_LIST}"\n\t<I${KEYCODE}>=${KEYCODE}; \/\/ ${KEYNAME}" + else + FULL_KEY_LIST=${FULL_KEY_LIST}"\n\t<${KEYNAME#XF86}>=${KEYCODE};" + fi +done < ${KEYMAP_FILE_PATH} + +echo ${FULL_KEY_LIST} + +sed -i "s/${CHANGE_STRING}/${FULL_KEY_LIST}/g" ${KEYCODES_PATH}${NEW_KEYCODES_NAME} + +sed -i "s/${DEFAULT_KEYCODES_NAME}/${NEW_KEYCODES_NAME}/g" ${KEYCODES_PATH}${NEW_KEYCODES_NAME} |