Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 5
Registered: ‎06-10-2009
My Device: Not Specified

How to implement KeyListener for TrackwheelScrool and WheelClick in Canvas Midlet

[ Edited ]

hai Guys,

 

I have a problem on How to implement keyListener for Canvas Midlet, I have a canvas class the scroll seems doesn't work. I have already put

 

Application.getApplication().addKeyListener( this ) ;

 

in canvas class but still no effect at all.

 

I have 1 question also on How To print out the System.out.println("debug"); on BlackBerry Simulator Output Console.

 

 

 

I Use Eclipse ganyMede and ejde 4.6.0

 

Thanks for Your help Smiley Happy

 

 

Regards,

 

 

Purbo

 

Developer
Posts: 16,838
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to implement KeyListener for TrackwheelScrool and WheelClick in Canvas Midlet

did you check the implementation notes? http://www.blackberry.com/developers/docs/5.0.0api/javax/microedition/lcdui/Canvas.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
New Developer
Posts: 5
Registered: ‎06-10-2009
My Device: Not Specified

Re: How to implement KeyListener for TrackwheelScrool and WheelClick in Canvas Midlet

 


simon_hain wrote:
did you check the implementation notes? http://www.blackberry.com/developers/docs/5.0.0api/javax/microedition/lcdui/Canvas.html

 

 

Thanks simon_hain I'll try I have to make sure that

keyPressed and keyReleased methods of the current Canvas object are called with the keyCode parameter having a value of Canvas.DOWN. by adding

 

    protected void keyPressed(int keyCode) {
       
        System.out.println("Keypress : "+ keyCode);

 

But the system doesn't print anything on console screen windows, is it true that this method wasn't called when I Scroll using trackpad ?

 

 

Thanks for Your Answer