support light keymap & locale mode 22/208422/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_9.0_unified accepted/tizen_unified tizen tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 tizen_9.0 tizen_bkup_20220215 accepted/tizen/5.5/unified/20191031.012717 accepted/tizen/5.5/unified/mobile/hotfix/20201027.071651 accepted/tizen/5.5/unified/wearable/hotfix/20201027.104704 accepted/tizen/6.0/unified/20201030.103757 accepted/tizen/6.0/unified/hotfix/20201103.050043 accepted/tizen/6.5/unified/20211029.015500 accepted/tizen/7.0/unified/20221110.063137 accepted/tizen/7.0/unified/hotfix/20221116.111547 accepted/tizen/8.0/unified/20231005.095657 accepted/tizen/9.0/unified/20241030.235625 accepted/tizen/unified/20190626.040931 submit/tizen/20190625.075742 submit/tizen_5.5/20191031.000008 submit/tizen_5.5_mobile_hotfix/20201026.185108 submit/tizen_5.5_wearable_hotfix/20201026.184308 submit/tizen_6.0/20201029.205504 submit/tizen_6.0_hotfix/20201102.192904 submit/tizen_6.0_hotfix/20201103.115104 submit/tizen_6.5/20211028.163901 tizen_5.5.m2_release tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release tizen_9.0_m2_release
authorjeon <jhyuni.kang@samsung.com>
Tue, 28 May 2019 11:12:47 +0000 (20:12 +0900)
committerjeon <jhyuni.kang@samsung.com>
Mon, 24 Jun 2019 07:18:14 +0000 (16:18 +0900)
Change-Id: I1104574567ce1d52d4093e5041302e18fa008c12

make_keycodes.sh
make_symbols.sh

index 176c3aa..d76d99f 100755 (executable)
@@ -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}"
index 6704002..a3bfae0 100755 (executable)
@@ -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