New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timob 10232: Android: Capturing onKeyPress from the hardware keyboard #3095
Conversation
@@ -696,17 +692,6 @@ public void processProperties(KrollDict d) | |||
nativeView.setEnabled(TiConvert.toBoolean(d, TiC.PROPERTY_ENABLED)); | |||
} | |||
|
|||
if (d.containsKey(TiC.PROPERTY_FOCUSABLE) && !nativeViewNull) { | |||
boolean focusable = TiConvert.toBoolean(d, TiC.PROPERTY_FOCUSABLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is moved to the registerForKeyPress() method which is called from TiViewProxy.handleGetView(). This design uses the similar logic as registerForTouch().
Code reviewed. Please address comments. |
Updated. |
@@ -1041,6 +1026,11 @@ protected boolean allowRegisterForTouch() | |||
return true; | |||
} | |||
|
|||
protected boolean allowRegisterForKeyPress() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this was for module developers to extend and use this functionality, then we need add a description, and a module.api annotation
Updated. |
Code reviewed. Request Accepted. @hieupham007 will do FR |
Functionally tested. onKeyPressed overwrite 'back' button as well. Not sure if this is a good idea. |
… care of by Android.
…e into timob-10232
Updated. Please review. |
- name: keyCode | ||
type: Number | ||
summary: The code for the physical key that was pressed. For more details, see [KeyEvent](http://developer.android.com/reference/android/view/KeyEvent.html). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an immediate customer need this may work, but if this is eventually going to be cross-platform, we can't send Android key codes back to the app--we'd need to provide some kind of Titanium class to map keycodes.
I think if we need to include this for this release, we should make a note that this API is experimental and subject to change. Or words to that effect.
Functional reviewed. Request accepted. |
Updated. Please review. |
Doc update accepted. |
Merging.. |
Timob 10232: Android: Capturing onKeyPress from the hardware keyboard
http://jira.appcelerator.org/browse/TIMOB-10232
Test case in JIRA.