BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links


BlackBerryApps.com Best Sellers



Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
dthunt Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Default KeyListener in Background - 02-06-2007, 05:31 PM

Hi,

I was wondering if it is possible to determine if the ALT key is pressed if my screen isnt in the foreground. An example of when this is useful is when the phone application comes up - it turns on the ALT status automatically. My application wants to know when this happens, even if my screen is not in the foreground.

Does anyone know if this is possible?

Thanks,
Dallan
   
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
jfisher Offline
CrackBerry Addict
 
Posts: 714
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Default 02-07-2007, 04:23 AM

not looked into it but it seems very unlikely.


new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
   
  (#3 (permalink)) Old
Skipper_Joe Offline
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Posts: 237
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Default 02-07-2007, 09:34 AM

maybe Application.addKeyListener() method and KeyListener interface implementation may help? I didn't tried it myself
   
  (#4 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Thumbs up model - 02-07-2007, 12:44 PM

Quote:
Originally Posted by dthunt
Hi,

I was wondering if it is possible to determine if the ALT key is pressed if my screen isnt in the foreground. An example of when this is useful is when the phone application comes up - it turns on the ALT status automatically. My application wants to know when this happens, even if my screen is not in the foreground.

Does anyone know if this is possible?

Thanks,
Dallan
What's your model? Because even with mine it always shows in the upper right hand corner. Symbols will very depending on model, platform and theme.


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#5 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Default ?!.. - 02-07-2007, 12:53 PM

What my concern is what is wrong with the editor to ask that. Normally I run a visual basic editor 6.0. Though I have not written BB software for it, the program will not ask unless your in a wizard.Now if the phone app is intilizied and the alt key is automatic, then the alt key should set a value of 2. If not then 1.In any case reset the value to zero shown hereThat should fall under the startboot or autorun file.Let me know if this helps.


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#6 (permalink)) Old
dthunt Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Default 02-07-2007, 01:16 PM

It may indicate that ALT has been pressed on the top of the screen, but I want to determine it programatically so I can bring up a PopupScreen or something.

The following works in keyStatus -

Keypad.status(keycode) == KeypadListener.STATUS_ALT

this returns true when the ALT is pressed, but keyStatus() seems only to get called when my screen is in the foreground. There must be a way to determine if the ALT is down at anytime, even if it is just to be able to check it.

Dallan
   
  (#7 (permalink)) Old
jfisher Offline
CrackBerry Addict
 
Posts: 714
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Default 02-07-2007, 01:27 PM

of course you can get the status of any key but you were asking about getting a key press from another application while your app is in the background? is this correct? - in this scenario i'm not sure it's possible.

(i have no idea what the two posters above are on about)


new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
   
  (#8 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Default solution - 02-07-2007, 01:30 PM

I think that you need an additional code for the ALT symbol to apper on the screen. Either on your PC or your BB.


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#9 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Default 02-07-2007, 01:39 PM

I think I know what's wrong, try on the BlackBerry pressing and hold alt and push the escape button. It's the = of control tab.And try a different method.The GetKey command or KedID command line in Basic will tell you, but remodify the line to have the program tell you what to do when certain buttons and combos are keyed.Hope it helps.


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#10 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Default refresher - 02-07-2007, 01:45 PM

Quote:
Originally Posted by jfisher
of course you can get the status of any key but you were asking about getting a key press from another application while your app is in the background? is this correct? - in this scenario i'm not sure it's possible.

(i have no idea what the two posters above are on about)
What dillan wants is to check the status of pressing the alt key. But mainly from an editor program. Some advise would be helpful. (I'm running out of ideas!)


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#11 (permalink)) Old
dthunt Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Default 02-07-2007, 01:50 PM

I don't even necessarily want my background app to be notified when the ALT is pressed, it would suffice to be able to find when I want if the ALT is pressed.

In response to the last post, Im familiar with the ALT+ESC for BB, but what is the KeyKey or KedID. I didn't quite understand what you're getting at.

Dallan
   
  (#12 (permalink)) Old
dthunt Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Default 02-07-2007, 01:52 PM

One more thing, the ALT status stays on the device after the ALT button is pressed until the next key is pressed, I believe - which is why I really only want to check if the device has entered the status of the ALT key.
   
  (#13 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Default clairification - 02-07-2007, 02:00 PM

Here is what I was trying to get at, the getKey function gets the keyed number that iditifies where it is on the keyboard. To show it in the fore ground, an extra command line will need to be added. Then, with the key numer, instert it in into the line used for showing it on the foreground what ever it maybe.Does that help?


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#14 (permalink)) Old
dthunt Offline
Knows Where the Search Button Is
 
Posts: 22
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Default 02-07-2007, 02:11 PM

I would have to try it out I guess, but I don't think it allows me to detect when the keyboard is in the ALT status.
   
  (#15 (permalink)) Old
virusboy286 Offline
Thumbs Must Hurt
 
virusboy286's Avatar
 
Posts: 188
Join Date: Feb 2007
Location: CO
Model: 8700g
Default if the keyboard - 02-07-2007, 04:02 PM

The keyboard is supposed to stay in alt mode until the next key is pressed or the alt keyed is pressed again.
Unless you programmed the function as a keyboard for computer function through the alt key. (By holding it down to get the desired effect)


Crackberry, the legal drug.

T-Mobile
8700g
   
  (#16 (permalink)) Old
jfisher Offline
CrackBerry Addict
 
Posts: 714
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Default 02-07-2007, 05:21 PM

ok, i'm jumping ship - this thread has turned surreal.


new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
   
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





Copyright © 2004-2009 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.