You wrote:
>Hi all, 
>
>I'm looking to create my own keyboard to display instead of the default keyboard 

(as the input is restricted to certain characters). How can I display my new 

keyboard instead of the existing ones when the 'ABC' or '123' corners of the 

graffiti pad are pressed? 
>
>Thanks in advance, 
>Kyle

What you need to do is catch the event that occurs when the 'ABC' or '123' is pressed, 
run a function to display the keyboard, and return true to the system so it doesn't 
draw it's own keyboard.

Here is the code you need to put in your event loop:

        if (KeyBoardCatch(&event))
                continue;

KeyBoardCatch() is a custom function.  It should be something like this

Boolean KeyBoardCatch(EventType *event)
{Boolean handled=false;
//if the event is not a keydown event, we don't want to mess with it.
if(event->eType!=keyDownEvent)
return handled;
//Check to see if the 123 or abc was pressed
switch(event->data.keyDown.chr)
{
case vchrKeyboardNumeric:
//123 was pressed
MyCustomNumericKeyboardDrawingFunction();
break;
case vchrKeyboardAlpha:
//abc was pressed
MyCustomKeyboardDrawingFunction();
//make sure to return true
handled=true;
break;  
default:
break;
}
return handled;
}

Now you need to put some code in the event loop:

//sample event loop
do {
        EvtGetEvent(&event, evtWaitForever);
//right here is where you need to insert the call to KeyBoardCatch
        if (KeyBoardCatch(&event))
                continue;       
//rest of event loop
        if (! SysHandleEvent(&event))
            if (! MenuHandleEvent(0, &event, &error))
                if (! ApplicationHandleEvent(&event))
                    FrmDispatchEvent(&event);
    } while (event.eType != appStopEvent);


Hope this helps.

Josh
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to