|
Post by sharkus on May 2, 2005 18:25:22 GMT 1
First off, this is an amazing app!
Would it be possible to support more hard buttons on the Treo 650?
Currently, only the d-pad, phone, calendar, mail, and off buttons can be assigned. Some requested options (in order of greatness):
- "home" and "menu pulldown" button support - Side buttons (rocker/select) - Full keyboard support
Also, is it possible to show a small overlay on the screen that shows the soft button locations? It seems to be hit or miss when trying to press these buttons (and a lot of the time the menu overlay appears, rather than the expected button press).
Thanks! Sharkus
|
|
|
Post by sharkus on May 3, 2005 1:19:20 GMT 1
Sorry, I just noticed this has been covered in other threads... Please feel free to flame at will...
|
|
|
Post by axiomjunglist on May 3, 2005 4:35:05 GMT 1
it's cool...I'm waiting patiently myself I'm sure it's on a to-do-list...just a matter of time
|
|
|
Post by sharkus on May 3, 2005 5:35:18 GMT 1
|
|
|
Post by Tinnus on May 3, 2005 19:19:13 GMT 1
Could you please copy and paste the code here? It needs you to register and I'm not in the mood to go through a lenghtly process just to read some code.
|
|
|
Post by sharkus on May 3, 2005 23:03:01 GMT 1
Following code borrowed from here: developers.palmone.com/pe/forums/displaypost.jsp?postID=10138135:
Posted Apr 17, 2005 by Tatsuo Nagamatsu This is a core part of KeyReplace application.
/****************************************************************************** * * Copyright (c) 2004 Tatsuo Nagamatsu (nagamatu@p.chan.ne.jp) * All rights reserved. * * File: KeyReplace.c * * Release: Palm OS SDK 5.0 (111823) * *****************************************************************************/
static Boolean PrvSysHandleEvent(EventPtr eventP) { KeyReplaceGlobalsPtr gP; UInt16 eType; struct _KeyDownEventType keyDown; Boolean handled = false;
eType = eventP->eType; eType = SwapEndian16(eType);
switch (eType) {
case keyDownEvent: keyDown = eventP->data.keyDown; keyDown.chr = SwapEndian16(keyDown.chr); keyDown.keyCode = SwapEndian16(keyDown.keyCode); keyDown.modifiers = SwapEndian16(keyDown.modifiers);
if (MatchWithTableEntryBinarySearch(&keyDown) != -1) { eventP->data.keyDown.chr = SwapEndian16(keyDown.chr); eventP->data.keyDown.keyCode = SwapEndian16(keyDown.keyCode); eventP->data.keyDown.modifiers = SwapEndian16(keyDown.modifiers); } break;
}
// Modify event type to nilEvent if handled is true if (handled) eventP->eType = SwapEndian16(nilEvent);
return (handled); }
static void SetupNotification(Boolean bEnable) { UInt16 cardNo; LocalID dbID; static Err notifyCallback(SysNotifyParamType *notifyParamsP); KeyReplaceGlobalsPtr gP = GetGlobalsPtr();
GetDatabaseInfo(&cardNo, &dbID);
if (bEnable) { SysNotifyRegister(cardNo, dbID, sysNotifyEventDequeuedEvent, notifyCallback, sysNotifyKeyReplacePriority, gP); SysNotifyRegister(cardNo, dbID, sysNotifyDeleteProtectedEvent, notifyCallback, sysNotifyNormalPriority, gP); } else { SysNotifyUnregister(cardNo, dbID, sysNotifyEventDequeuedEvent, sysNotifyKeyReplacePriority); SysNotifyUnregister(cardNo, dbID, sysNotifyDeleteProtectedEvent, sysNotifyNormalPriority); } }
static Err notifyCallback(SysNotifyParamType *notifyParamsP) { KeyReplaceGlobalsPtr gP = (KeyReplaceGlobalsPtr)notifyParamsP->userDataP;
switch (notifyParamsP->notifyType) { case sysNotifyEventDequeuedEvent: PrvSysHandleEvent((EventPtr)notifyParamsP->notifyDetailsP); break; case sysNotifyDeleteProtectedEvent: DoEnableDisable(false); break; }
return (errNone); }
|
|
|
Post by Tinnus on May 3, 2005 23:18:21 GMT 1
This app uses events to capture keypresses while LJP checks each key's status directly. Checking directly is a lot faster because well.... it's direct Events means you'll have to get through a lot of layers until you get the key press... a lot slower.
|
|
|
Post by sharkus on May 4, 2005 6:29:42 GMT 1
Browsing the PalmOne SDK I came across the following API definition... It looks like this could be used to extend the KeyCurrentState() function call to support extra hardware buttons on the Treo (or other PalmOne devices).
UInt16 PmKeyKeysPressed ( UInt16 refNum, UInt16 count, const UInt16 keyCodes[], Boolean pressed[] )
Get the current state of specified keys
Parameters: refNum: IN: library reference number (returned by SysLibFind() / SysLibLoad() ) count: IN: number of elements in keyCodes[] and pressed[] keyCodes: IN: array of keyCodes to test pressed: OUT: Each element is set to true if the key specified by the corresponding element in keyCodes[] is pressed, and set to false if it is not pressed. It is acceptable to pass NULL if only the return value is of interest.
Return values: UInt16 count of keys that are pressed.
|
|
|
Post by metaview on May 4, 2005 11:38:01 GMT 1
What I will add to MyUAE, when I get the time:
/* if (g_treo600_sdk || g_treo650_sdk) { UInt16 keyCodes[50] = {keyBackspace, keyTab, keyReturn, keyEscape, keySpace, keySingleQuote, keyComma, keyDash, keyPeriod, keySlash, keyZero, keyOne, keyTwo, keyThree, keyFour, keyFive, keySix, keySeven, keyEight, keyNine, keySemiColon, keyLessThan, keyEquals, keyBackslash, keyA, keyB, keyC, keyD, keyE, keyF, keyG, keyH, keyI, keyJ, keyK, keyL, keyM, keyN, keyO, keyP, keyQ, keyR, keyS, keyT, keyU, keyV, keyW, keyX, keyY, keyZ}; Boolean keyPressed[50]; stub_HsKeysPressed(50, keyCodes, keyPressed); for (i=0; i<50; i++) { if (keyPressed) { // handle the keypress break; } } } */
Regards Henk
|
|
|
Post by metaview on May 4, 2005 11:51:55 GMT 1
Browsing the PalmOne SDK I came across the following API definition... It looks like this could be used to extend the KeyCurrentState() function call to support extra hardware buttons on the Treo (or other PalmOne devices).
UInt16 PmKeyKeysPressed ( UInt16 refNum, UInt16 count, const UInt16 keyCodes[], Boolean pressed[] )
Get the current state of specified keys
Parameters: refNum: IN: library reference number (returned by SysLibFind() / SysLibLoad() ) count: IN: number of elements in keyCodes[] and pressed[] keyCodes: IN: array of keyCodes to test pressed: OUT: Each element is set to true if the key specified by the corresponding element in keyCodes[] is pressed, and set to false if it is not pressed. It is acceptable to pass NULL if only the return value is of interest.
Return values: UInt16 count of keys that are pressed.
Sounds interesting, but I guess for now, the Hs stuff is as good as the Pm stuff. The question is if the keyboard of the Tungsten C can be polled by thePm functions. Regards Henk
|
|