Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
6c92ee12
Commit
6c92ee12
authored
14 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Refactor symbol key state into KeyboardSwitcher
Change-Id: Idce4e9bf070b08b8a930fd8e800df9c4d8829f8f
parent
e3f0ca38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+18
-0
18 additions, 0 deletions
java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
java/src/com/android/inputmethod/latin/LatinIME.java
+4
-5
4 additions, 5 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
with
22 additions
and
5 deletions
java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+
18
−
0
View file @
6c92ee12
...
@@ -75,6 +75,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
...
@@ -75,6 +75,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private
final
LatinIME
mInputMethodService
;
private
final
LatinIME
mInputMethodService
;
private
final
LanguageSwitcher
mLanguageSwitcher
;
private
final
LanguageSwitcher
mLanguageSwitcher
;
private
ModifierKeyState
mSymbolKeyState
=
new
ModifierKeyState
();
private
KeyboardId
mSymbolsId
;
private
KeyboardId
mSymbolsId
;
private
KeyboardId
mSymbolsShiftedId
;
private
KeyboardId
mSymbolsShiftedId
;
...
@@ -382,6 +383,23 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
...
@@ -382,6 +383,23 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
mInputView
.
setShiftLocked
(
shiftLocked
);
mInputView
.
setShiftLocked
(
shiftLocked
);
}
}
public
void
onPressSymbol
()
{
mSymbolKeyState
.
onPress
();
}
public
void
onReleaseSymbol
()
{
mSymbolKeyState
.
onRelease
();
}
public
boolean
isSymbolMomentary
()
{
return
mSymbolKeyState
.
isMomentary
();
}
public
void
onOtherKeyPressed
()
{
// TODO: shift key state will be handled too.
mSymbolKeyState
.
onOtherKeyPressed
();
}
public
void
toggleShift
()
{
public
void
toggleShift
()
{
if
(
isAlphabetMode
())
if
(
isAlphabetMode
())
return
;
return
;
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/LatinIME.java
+
4
−
5
View file @
6c92ee12
...
@@ -241,7 +241,6 @@ public class LatinIME extends InputMethodService
...
@@ -241,7 +241,6 @@ public class LatinIME extends InputMethodService
// Modifier keys state
// Modifier keys state
private
final
ModifierKeyState
mShiftKeyState
=
new
ModifierKeyState
();
private
final
ModifierKeyState
mShiftKeyState
=
new
ModifierKeyState
();
private
final
ModifierKeyState
mSymbolKeyState
=
new
ModifierKeyState
();
private
Tutorial
mTutorial
;
private
Tutorial
mTutorial
;
...
@@ -2323,11 +2322,11 @@ public class LatinIME extends InputMethodService
...
@@ -2323,11 +2322,11 @@ public class LatinIME extends InputMethodService
handleShift
();
handleShift
();
}
}
}
else
if
(
distinctMultiTouch
&&
primaryCode
==
BaseKeyboard
.
KEYCODE_MODE_CHANGE
)
{
}
else
if
(
distinctMultiTouch
&&
primaryCode
==
BaseKeyboard
.
KEYCODE_MODE_CHANGE
)
{
mSymbolKeyState
.
onPress
();
switcher
.
onPress
Symbol
();
changeKeyboardMode
();
changeKeyboardMode
();
}
else
{
}
else
{
mShiftKeyState
.
onOtherKeyPressed
();
mShiftKeyState
.
onOtherKeyPressed
();
mSymbolKeyState
.
onOtherKeyPressed
();
switcher
.
onOtherKeyPressed
();
}
}
}
}
...
@@ -2352,10 +2351,10 @@ public class LatinIME extends InputMethodService
...
@@ -2352,10 +2351,10 @@ public class LatinIME extends InputMethodService
}
}
mShiftKeyState
.
onRelease
();
mShiftKeyState
.
onRelease
();
}
else
if
(
distinctMultiTouch
&&
primaryCode
==
BaseKeyboard
.
KEYCODE_MODE_CHANGE
)
{
}
else
if
(
distinctMultiTouch
&&
primaryCode
==
BaseKeyboard
.
KEYCODE_MODE_CHANGE
)
{
if
(
mSymbolKeyState
.
is
Momentary
())
{
if
(
switcher
.
isSymbol
Momentary
())
{
changeKeyboardMode
();
changeKeyboardMode
();
}
}
mSymbolKeyState
.
onRelease
();
switcher
.
onRelease
Symbol
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment