BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-29-2008, 10:18 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default I am looking for a listener !!!???

Please Login to Remove!

Is there any listener, that can observe any trackwheel/key click. I want to made my application (running in background or foreground) starts some actions after 5 minutes (for example) after a key/trackwheel was pressed. Is there any system timer that increases its count until key is pressed, when a key is pressed the timer, should initialize its counter to 0? If I have to make my own timer, I think this will discharge the phone battery faster. What do you think about it ? Thanks !
Offline  
Old 07-29-2008, 10:28 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

nope, you can only get these events if your uiapplication is in the foreground
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 07-29-2008, 10:39 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Take a look at DeviceInfo.getIdleTime().
Offline  
Old 07-29-2008, 10:47 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I saw it....but I have to check every minute if the result of that function equals the time i set (5 minutes i told before). The other idea that came to my mind is to make a timer that increases itself then if key is pressed gets its counter to 0, and when the timer count equals the time I set, the actions to be done. Maybe these are the only two possibilities. Which is better having in mind speed and battery discharging? Thanks !
Offline  
Old 07-29-2008, 12:14 PM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

for reasons I never thought were useful until now, all the action methos (keychar, keycharUnhandled, trackwheelRoll,click) pass in 'time' (measured from device start time). you could use that here
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Lot of 5 Nextel Blackberry 7520 and 1 7510 - For Parts - Accessories Included
$29.95
Lot of 5 Nextel Blackberry 7520 and 1 7510 - For Parts - Accessories Included pictureLot of 14 Blackberry 9650 Verizon Smartphone (As-Is)
$100.0
Lot of 14 Blackberry 9650 Verizon Smartphone (As-Is) pictureLot of 27 Blackberry 9930 Verizon Smartphone (As-Is)
$100.0
Lot of 27 Blackberry 9930 Verizon Smartphone (As-Is) pictureBlackBerry Unlock Code AT&T USA Blackberry Curve 8320 8520 Clean imei only
$1.99
BlackBerry Unlock Code AT&T USA Blackberry Curve 8320 8520 Clean imei only pictureBlackBerry Unlock Code AT&T USA Blackberry STL100 3 Clean imei only
$20.0
BlackBerry Unlock Code AT&T USA Blackberry STL100 3 Clean imei only picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.