Skip to content
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

Merged
merged 7 commits into from Oct 10, 2012

Conversation

pingwang2011
Copy link
Contributor

@ghost ghost assigned hieupham007 Oct 3, 2012
@@ -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);
Copy link
Contributor

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?

Copy link
Contributor Author

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().

@hieupham007
Copy link
Contributor

Code reviewed. Please address comments.

@pingwang2011
Copy link
Contributor Author

Updated.

@@ -1041,6 +1026,11 @@ protected boolean allowRegisterForTouch()
return true;
}

protected boolean allowRegisterForKeyPress()
Copy link
Contributor

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

@pingwang2011
Copy link
Contributor Author

Updated.

@ayeung
Copy link
Contributor

ayeung commented Oct 9, 2012

Code reviewed. Request Accepted. @hieupham007 will do FR

@hieupham007
Copy link
Contributor

Functionally tested. onKeyPressed overwrite 'back' button as well. Not sure if this is a good idea.

@pingwang2011
Copy link
Contributor Author

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).

Copy link
Contributor

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.

@hieupham007
Copy link
Contributor

Functional reviewed. Request accepted.

@pingwang2011
Copy link
Contributor Author

Updated. Please review.

@arthurevans
Copy link
Contributor

Doc update accepted.

@hieupham007
Copy link
Contributor

Merging..

hieupham007 added a commit that referenced this pull request Oct 10, 2012
Timob 10232: Android: Capturing onKeyPress from the hardware keyboard
@hieupham007 hieupham007 merged commit 9b1babd into tidev:master Oct 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants