diff options
author | jeon <jhyuni.kang@samsung.com> | 2019-05-28 20:12:47 +0900 |
---|---|---|
committer | jeon <jhyuni.kang@samsung.com> | 2019-06-24 16:18:14 +0900 |
commit | 322ddb3cebffb3e0a1c62ea8f7f8f89a2b8164d7 (patch) | |
tree | ef7482b83bc9d32dd4cd35c0e461604c740680f6 | |
parent | c0927b5ab9124528e8626bcccc5d0750a7b90b7d (diff) | |
download | xkeyboard-config-accepted/tizen_unified.tar.gz xkeyboard-config-accepted/tizen_unified.tar.bz2 xkeyboard-config-accepted/tizen_unified.zip |
support light keymap & locale modeHEADtizen_9.0_m2_releasetizen_8.0_m2_releasetizen_7.0_m2_releasetizen_6.5.m2_releasetizen_6.0.m2_releasetizen_5.5.m2_releasesubmit/tizen_6.5/20211028.163901submit/tizen_6.0_hotfix/20201103.115104submit/tizen_6.0_hotfix/20201102.192904submit/tizen_6.0/20201029.205504submit/tizen_5.5_wearable_hotfix/20201026.184308submit/tizen_5.5_mobile_hotfix/20201026.185108submit/tizen_5.5/20191031.000008submit/tizen/20190625.075742accepted/tizen/unified/20190626.040931accepted/tizen/9.0/unified/20241030.235625accepted/tizen/8.0/unified/20231005.095657accepted/tizen/7.0/unified/hotfix/20221116.111547accepted/tizen/7.0/unified/20221110.063137accepted/tizen/6.5/unified/20211029.015500accepted/tizen/6.0/unified/hotfix/20201103.050043accepted/tizen/6.0/unified/20201030.103757accepted/tizen/5.5/unified/wearable/hotfix/20201027.104704accepted/tizen/5.5/unified/mobile/hotfix/20201027.071651accepted/tizen/5.5/unified/20191031.012717tizen_bkup_20220215tizen_9.0tizen_8.0tizen_7.0_hotfixtizen_7.0tizen_6.5tizen_6.0_hotfixtizen_6.0tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixtizen_5.5tizenaccepted/tizen_unifiedaccepted/tizen_9.0_unifiedaccepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.5_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unifiedaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unified
Change-Id: I1104574567ce1d52d4093e5041302e18fa008c12
-rwxr-xr-x | make_keycodes.sh | 52 | ||||
-rwxr-xr-x | make_symbols.sh | 122 |
2 files changed, 130 insertions, 44 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}" diff --git a/make_symbols.sh b/make_symbols.sh index 67040023..a3bfae01 100755 --- a/make_symbols.sh +++ b/make_symbols.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ "$TZ_SYS_RO_SHARE" = "" ]; then - TZ_SYS_RO_SHARE="/usr/share" + TZ_SYS_RO_SHARE="/usr/share" fi SYMBOLS_PATH="./symbols/inet" @@ -11,6 +11,7 @@ NEW_SYMBOLS_NAME="tizen" DEFAULT_SYMBOLS_SECTION=false TEMP_SYMBOLS_FILE="./symbols/inet_tizen" PLATFORM_BASE_KEYCODE=8 +RULE_FILE=${RULE_FILE_PATH} if [ -e ${KEYMAP_FILE_PATH} ] then @@ -20,6 +21,22 @@ else exit fi +_light_keymap_mode=false +_light_locale_mode=false + +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 "Generate a tizen symbol file" if [ -e ${TEMP_SYMBOLS_FILE} ] @@ -27,47 +44,68 @@ then rm ${TEMP_SYMBOLS_FILE} fi -while read line -do - if echo ${line} | grep -q ${DEFAULT_SYMBOLS_DEFINE}; - then - DEFAULT_SYMBOLS_SECTION=true - fi +if [ "${_light_keymap_mode}" == "true" ]; then + echo "// Tizen Standardized Keycodes" >> ${TEMP_SYMBOLS_FILE} + echo "partial alphanumeric_keys" >> ${TEMP_SYMBOLS_FILE} + echo "xkb_symbols \"tizen\" {" >> ${TEMP_SYMBOLS_FILE} + + while read KEYNAME KERNEL_KEYCODE OPTS + do + EXTRA_OPTS=", repeat=False" + [[ $OPTS == *"repeat"* ]] && EXTRA_OPTS=", repeat=True" + + KERNEL_KEYCODE=$(echo $(($KERNEL_KEYCODE+$PLATFORM_BASE_KEYCODE))) + KEYCODE="${KERNEL_KEYCODE}" + echo "key <I$KEYCODE> { [ ${KEYNAME} ] ${EXTRA_OPTS} };" >> ${TEMP_SYMBOLS_FILE} + done < ${KEYMAP_FILE_PATH} + + echo "};" >> ${TEMP_SYMBOLS_FILE} + + mv ${TEMP_SYMBOLS_FILE} ${SYMBOLS_PATH} +else + while read line + do + if echo ${line} | grep -q ${DEFAULT_SYMBOLS_DEFINE}; + then + DEFAULT_SYMBOLS_SECTION=true + fi - if [ "$DEFAULT_SYMBOLS_SECTION" = true ] - then - if [ "$line" = "};" ] + if [ "$DEFAULT_SYMBOLS_SECTION" = true ] then - DEFAULT_SYMBOLS_SECTION=false - else - echo "$line" >> ${TEMP_SYMBOLS_FILE} + if [ "$line" = "};" ] + then + DEFAULT_SYMBOLS_SECTION=false + else + echo "$line" >> ${TEMP_SYMBOLS_FILE} + fi fi - fi -done < ${SYMBOLS_PATH} - -echo "" >> ${TEMP_SYMBOLS_FILE} -echo "// Tizen common keys" >> ${TEMP_SYMBOLS_FILE} -while read KEYNAME KERNEL_KEYCODE OPTS -do - [[ $OPTS == *"keyboard"* ]] && continue - - EXTRA_OPTS=", repeat=False" - [[ $OPTS == *"repeat"* ]] && EXTRA_OPTS=", repeat=True" - - KERNEL_KEYCODE=$(echo $(($KERNEL_KEYCODE+$PLATFORM_BASE_KEYCODE))) - KEYCODE="${KERNEL_KEYCODE}" - echo "key <I$KEYCODE> { [ ${KEYNAME} ] ${EXTRA_OPTS} };" >> ${TEMP_SYMBOLS_FILE} -done < ${KEYMAP_FILE_PATH} -echo "};" >> ${TEMP_SYMBOLS_FILE} - -sed -i "s/${DEFAULT_SYMBOLS_NAME}/${NEW_SYMBOLS_NAME}/g" ${TEMP_SYMBOLS_FILE} -sed -i 's/Evdev/Tizen/g' ${TEMP_SYMBOLS_FILE} - -echo "" >> ${SYMBOLS_PATH} -echo "" >> ${SYMBOLS_PATH} -while read line -do - echo "$line" >> ${SYMBOLS_PATH} -done < ${TEMP_SYMBOLS_FILE} - -rm ${TEMP_SYMBOLS_FILE} + done < ${SYMBOLS_PATH} + + echo "" >> ${TEMP_SYMBOLS_FILE} + echo "// Tizen common keys" >> ${TEMP_SYMBOLS_FILE} + while read KEYNAME KERNEL_KEYCODE OPTS + do + [[ $OPTS == *"keyboard"* ]] && continue + + EXTRA_OPTS=", repeat=False" + [[ $OPTS == *"repeat"* ]] && EXTRA_OPTS=", repeat=True" + + KERNEL_KEYCODE=$(echo $(($KERNEL_KEYCODE+$PLATFORM_BASE_KEYCODE))) + KEYCODE="${KERNEL_KEYCODE}" + echo "key <I$KEYCODE> { [ ${KEYNAME} ] ${EXTRA_OPTS} };" >> ${TEMP_SYMBOLS_FILE} + done < ${KEYMAP_FILE_PATH} + + echo "};" >> ${TEMP_SYMBOLS_FILE} + sed -i "s/${DEFAULT_SYMBOLS_NAME}/${NEW_SYMBOLS_NAME}/g" ${TEMP_SYMBOLS_FILE} + sed -i 's/Evdev/Tizen/g' ${TEMP_SYMBOLS_FILE} + + echo "" >> ${SYMBOLS_PATH} + echo "" >> ${SYMBOLS_PATH} + + while read line + do + echo "$line" >> ${SYMBOLS_PATH} + done < ${TEMP_SYMBOLS_FILE} + + rm ${TEMP_SYMBOLS_FILE} +fi |