From 6ec6f79e1ac1714e3b837796e99f07ff88f66601 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 17 Apr 2012 16:52:41 -0700 Subject: Support loading keyboard layout overlays from resources. Added the concept of a keyboard layout overlay, which is a key character map file that has "type OVERLAY". Added support for loading keyboard layout overlays from resources dynamically. The layouts are reloaded whenever they are changed in the Settings application or an application is installed. This is somewhat more aggressive than necessary so we might want to optimize it later. Before system-ready, the input system uses just the generic keyboard layouts that are included on the device system image. After system-ready, it considers the user's selected keyboard layout overlay and attempts to load it as necessary. We need to wait until system-ready before doing this because we need to be in a state where it is safe to start applications or access their resources. Bug: 6110399 Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323 --- .../InputDevices/res/raw/keyboard_layout_english_us.kcm | 7 ++++++- .../res/raw/keyboard_layout_english_us_dvorak.kcm | 15 ++++++++++++++- packages/InputDevices/res/raw/keyboard_layout_german.kcm | 6 +++++- 3 files changed, 25 insertions(+), 3 deletions(-) (limited to 'packages/InputDevices/res/raw') diff --git a/packages/InputDevices/res/raw/keyboard_layout_english_us.kcm b/packages/InputDevices/res/raw/keyboard_layout_english_us.kcm index a7823fd..2c663bc 100644 --- a/packages/InputDevices/res/raw/keyboard_layout_english_us.kcm +++ b/packages/InputDevices/res/raw/keyboard_layout_english_us.kcm @@ -12,4 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# PLACEHOLDER CONTENT # +# +# English (US) keyboard layout. +# Assumes that the base keyboard layout is already English (US). +# + +type OVERLAY diff --git a/packages/InputDevices/res/raw/keyboard_layout_english_us_dvorak.kcm b/packages/InputDevices/res/raw/keyboard_layout_english_us_dvorak.kcm index a7823fd..b5bf2ef 100644 --- a/packages/InputDevices/res/raw/keyboard_layout_english_us_dvorak.kcm +++ b/packages/InputDevices/res/raw/keyboard_layout_english_us_dvorak.kcm @@ -12,4 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -# PLACEHOLDER CONTENT # +# +# English (US), Dvorak keyboard layout. +# Assumes that the base keyboard layout is already English (US). +# + +type OVERLAY + +# Test +key A { + label: 'X' + base: 'x' + shift, capslock: 'X' + ctrl, alt, meta: none +} diff --git a/packages/InputDevices/res/raw/keyboard_layout_german.kcm b/packages/InputDevices/res/raw/keyboard_layout_german.kcm index a7823fd..6b3b3b4 100644 --- a/packages/InputDevices/res/raw/keyboard_layout_german.kcm +++ b/packages/InputDevices/res/raw/keyboard_layout_german.kcm @@ -12,4 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# PLACEHOLDER CONTENT # +# +# German keyboard layout. +# + +type OVERLAY -- cgit v1.1