Hello, I know how to add new KEYCODE's to the KeyEvent, but I want to avoid that. The 4 buttons are essentially defined as S1, S2, S3 and S4 and their functionality will change based on what the application wants them to be. In some instances they'll function as volume up/down and channel up/down buttons, in other instances something else, either way they application dependent.
I also do not want to submit these KEYCODEs to be included in the standard SDK as they don't have a specific defined purpose AND (and that's a VERY big and) the user would have to be using the device that we are building which isn't for commercial use.. So I would really appreciate any pointers on adding KEYCODES separately from the SDK's KeyEvent system but still using the onKeyUp/onKeyDown system to send my KEYCODES.. -- Ashwin On Thu, Mar 25, 2010 at 9:33 PM, Chih-Wei <[email protected]> wrote: > Why do you need to add new keycode if it only has 4 buttons? > What functions do you expect to add? > > If you really want to do, see my patch for how to add > PageUp & PageDown to android. > > https://review.source.android.com/#change,10065 > > (it is verified, but I don't understand why it's still not been added > to AOSP) > > > On 3月26日, 上午3時06分, Ashwin Bihari <[email protected]> wrote: >> I've got a device that has 4 buttons that are indeed by an application >> that will run on this device. Initially I went the route of modifying >> the KeyEvent.java file and adding new KEYCODE entries for these >> buttons. That approach worked but required recompiling a custom SDK >> that included these defines and the customer would like to avoid >> having to do that. >> >> So now I'm thinking I can create a new SDK Add On that defines these 4 >> keys and use that. However, I'm at a complete loss at where to start >> to do what I need. I was initially thinking perhaps of extending >> KeyEvent and defining my 4 KEYCODE's, but then how do I trigger the >> onKeyDown and onKeyUp events with my KEYCODES passed in along with the >> default KEYCODES? >> >> I've been looking at the SoftKeyboard sample code which talks about >> how to intercept keys to do special handling, but it assumes that the >> keys are already known values and not new KEYCODES that you want to >> pass along to an application above.. >> >> Any thoughts? >> >> Regards >> -- Ashwin > > -- > unsubscribe: [email protected] > website: http://groups.google.com/group/android-porting > > To unsubscribe from this group, send email to > android-porting+unsubscribegooglegroups.com or reply to this email with the > words "REMOVE ME" as the subject. > -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting To unsubscribe from this group, send email to android-porting+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
