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
3297ee80
Commit
3297ee80
authored
14 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
14 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Long pressing mic/comma key will show settings menue" into gingerbread
parents
77c9f2d3
a1cc4f0a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/values/bools.xml
+1
-0
1 addition, 0 deletions
java/res/values/bools.xml
java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+20
-10
20 additions, 10 deletions
.../src/com/android/inputmethod/latin/LatinKeyboardView.java
with
21 additions
and
10 deletions
java/res/values/bools.xml
+
1
−
0
View file @
3297ee80
...
@@ -29,4 +29,5 @@
...
@@ -29,4 +29,5 @@
<!-- Whether or not Popup on key press is enabled by default -->
<!-- Whether or not Popup on key press is enabled by default -->
<bool
name=
"default_popup_preview"
>
true
</bool>
<bool
name=
"default_popup_preview"
>
true
</bool>
<bool
name=
"default_recorrection_enabled"
>
true
</bool>
<bool
name=
"default_recorrection_enabled"
>
true
</bool>
<bool
name=
"config_long_press_comma_for_settings_enabled"
>
true
</bool>
</resources>
</resources>
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+
20
−
10
View file @
3297ee80
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
com.android.inputmethod.latin
;
package
com.android.inputmethod.latin
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.graphics.Canvas
;
import
android.graphics.Canvas
;
import
android.graphics.Paint
;
import
android.graphics.Paint
;
import
android.inputmethodservice.Keyboard
;
import
android.inputmethodservice.Keyboard
;
...
@@ -41,6 +42,8 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
...
@@ -41,6 +42,8 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
private
Keyboard
mPhoneKeyboard
;
private
Keyboard
mPhoneKeyboard
;
private
final
boolean
mLongPressCommaForSettingsEnabled
;
/** Whether we've started dropping move events because we found a big jump */
/** Whether we've started dropping move events because we found a big jump */
private
boolean
mDroppingEvents
;
private
boolean
mDroppingEvents
;
/**
/**
...
@@ -54,11 +57,15 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
...
@@ -54,11 +57,15 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
private
int
mLastRowY
;
private
int
mLastRowY
;
public
LatinKeyboardView
(
Context
context
,
AttributeSet
attrs
)
{
public
LatinKeyboardView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
this
(
context
,
attrs
,
0
);
}
}
public
LatinKeyboardView
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
public
LatinKeyboardView
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
super
(
context
,
attrs
,
defStyle
);
Resources
res
=
context
.
getResources
();
mLongPressCommaForSettingsEnabled
=
res
.
getBoolean
(
R
.
bool
.
config_long_press_comma_for_settings_enabled
);
}
}
public
void
setPhoneKeyboard
(
Keyboard
phoneKeyboard
)
{
public
void
setPhoneKeyboard
(
Keyboard
phoneKeyboard
)
{
...
@@ -90,22 +97,25 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
...
@@ -90,22 +97,25 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
protected
boolean
onLongPress
(
Key
key
)
{
protected
boolean
onLongPress
(
Key
key
)
{
int
primaryCode
=
key
.
codes
[
0
];
int
primaryCode
=
key
.
codes
[
0
];
if
(
primaryCode
==
KEYCODE_OPTIONS
)
{
if
(
primaryCode
==
KEYCODE_OPTIONS
)
{
getOnKeyboardActionListener
().
onKey
(
KEYCODE_OPTIONS_LONGPRESS
,
null
,
return
invokeOnKey
(
KEYCODE_OPTIONS_LONGPRESS
);
LatinKeyboardBaseView
.
NOT_A_TOUCH_COORDINATE
,
LatinKeyboardBaseView
.
NOT_A_TOUCH_COORDINATE
);
return
true
;
}
else
if
(
primaryCode
==
'0'
&&
getKeyboard
()
==
mPhoneKeyboard
)
{
}
else
if
(
primaryCode
==
'0'
&&
getKeyboard
()
==
mPhoneKeyboard
)
{
// Long pressing on 0 in phone number keypad gives you a '+'.
// Long pressing on 0 in phone number keypad gives you a '+'.
getOnKeyboardActionListener
().
onKey
(
return
invokeOnKey
(
'+'
);
'+'
,
null
,
}
else
if
(
primaryCode
==
KEYCODE_VOICE
LatinKeyboardBaseView
.
NOT_A_TOUCH_COORDINATE
,
||
(
primaryCode
==
','
&&
mLongPressCommaForSettingsEnabled
))
{
LatinKeyboardBaseView
.
NOT_A_TOUCH_COORDINATE
);
return
invokeOnKey
(
KEYCODE_OPTIONS
);
return
true
;
}
else
{
}
else
{
return
super
.
onLongPress
(
key
);
return
super
.
onLongPress
(
key
);
}
}
}
}
private
boolean
invokeOnKey
(
int
primaryCode
)
{
getOnKeyboardActionListener
().
onKey
(
primaryCode
,
null
,
LatinKeyboardBaseView
.
NOT_A_TOUCH_COORDINATE
,
LatinKeyboardBaseView
.
NOT_A_TOUCH_COORDINATE
);
return
true
;
}
@Override
@Override
protected
CharSequence
adjustCase
(
CharSequence
label
)
{
protected
CharSequence
adjustCase
(
CharSequence
label
)
{
Keyboard
keyboard
=
getKeyboard
();
Keyboard
keyboard
=
getKeyboard
();
...
...
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