add modifier keys in terminal app
Except ctrl key, it just generates a matched keycode to the view
ctrl key, it enables javascript variable `ctrl`, and handler inside
xtermjs reads ctrl variable and the keycode, and if it is convertible
to ctrl keycode, it does.
Test: test added keys
Bug: 376813452
Change-Id: I22e5f80ca75ffe6426b7374855cdd015ad08f324
diff --git a/android/TerminalApp/res/values/keyboard_btn_strings.xml b/android/TerminalApp/res/values/keyboard_btn_strings.xml
new file mode 100644
index 0000000..384c583
--- /dev/null
+++ b/android/TerminalApp/res/values/keyboard_btn_strings.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="btn_esc_text" translatable="false">Esc</string>
+ <string name="btn_tab_text" translatable="false">Tab</string>
+ <string name="btn_home_text" translatable="false">Home</string>
+ <string name="btn_up_text" translatable="false">↑</string>
+ <string name="btn_end_text" translatable="false">End</string>
+ <string name="btn_pgup_text" translatable="false">PgUp</string>
+ <string name="btn_ctrl_text" translatable="false">Ctrl</string>
+ <string name="btn_alt_text" translatable="false">Alt</string>
+ <string name="btn_left_text" translatable="false">←</string>
+ <string name="btn_down_text" translatable="false">↓</string>
+ <string name="btn_right_text" translatable="false">→</string>
+ <string name="btn_pgdn_text" translatable="false">PgDn</string>
+</resources>
diff --git a/android/TerminalApp/res/values/styles.xml b/android/TerminalApp/res/values/styles.xml
new file mode 100644
index 0000000..ee80862
--- /dev/null
+++ b/android/TerminalApp/res/values/styles.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <style name="ModifierKeyStyle" parent="@style/Widget.Material3.Button.TextButton">
+ <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:layout_width">0dp</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:paddingHorizontal">0dp</item>
+ <item name="android:hapticFeedbackEnabled">true</item>
+ </style>
+</resources>
\ No newline at end of file