BlackBerry Forums Support Community
              

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

Please Login to Remove!

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
Offline  
Old 02-07-2007, 04:23 AM   #2
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

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!
Offline  
Old 02-07-2007, 09:34 AM   #3
Skipper_Joe
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Default

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

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
Offline  
Old 02-07-2007, 12:53 PM   #5
virusboy286
Thumbs Must Hurt
 
virusboy286's Avatar
 
Join Date: Feb 2007
Location: CO
Model: 8700g
Posts: 188
Default ?!..

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
Offline  
Old 02-07-2007, 01:16 PM   #6
dthunt
Knows Where the Search Button Is
 
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Posts: 22
Default

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
Offline  
Old 02-07-2007, 01:27 PM   #7
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

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!
Offline  
Old 02-07-2007, 01:30 PM   #8
virusboy286
Thumbs Must Hurt
 
virusboy286's Avatar
 
Join Date: Feb 2007
Location: CO
Model: 8700g
Posts: 188
Default solution

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
Offline  
Old 02-07-2007, 01:39 PM   #9
virusboy286
Thumbs Must Hurt
 
virusboy286's Avatar
 
Join Date: Feb 2007
Location: CO
Model: 8700g
Posts: 188
Default

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
Offline  
Old 02-07-2007, 01:45 PM   #10
virusboy286
Thumbs Must Hurt
 
virusboy286's Avatar
 
Join Date: Feb 2007
Location: CO
Model: 8700g
Posts: 188
Default refresher

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
Offline  
Old 02-07-2007, 01:50 PM   #11
dthunt
Knows Where the Search Button Is
 
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Posts: 22
Default

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
Offline  
Old 02-07-2007, 01:52 PM   #12
dthunt
Knows Where the Search Button Is
 
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Posts: 22
Default

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.
Offline  
Old 02-07-2007, 02:00 PM   #13
virusboy286
Thumbs Must Hurt
 
virusboy286's Avatar
 
Join Date: Feb 2007
Location: CO
Model: 8700g
Posts: 188
Default clairification

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
Offline  
Old 02-07-2007, 02:11 PM   #14
dthunt
Knows Where the Search Button Is
 
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Posts: 22
Default

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.
Offline  
Old 02-07-2007, 04:02 PM   #15
virusboy286
Thumbs Must Hurt
 
virusboy286's Avatar
 
Join Date: Feb 2007
Location: CO
Model: 8700g
Posts: 188
Default if the keyboard

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
Offline  
Old 02-07-2007, 05:21 PM   #16
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

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!
Offline  
Old 02-07-2007, 05:25 PM   #17
John Clark
BBF Moderator
 
John Clark's Avatar
 
Join Date: Jun 2005
Model: Z30
OS: 10.2.1.x
PIN: s & needles
Carrier: AT&T
Posts: 34,720
Default

Yes it has...
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


New Rexroth coil 1837001227 picture

New Rexroth coil 1837001227

$214.00



Allen Bradley 700-P000A1 New Control Relay Ser. D 115V Coil (GR139) picture

Allen Bradley 700-P000A1 New Control Relay Ser. D 115V Coil (GR139)

$99.99



Ignition Coil For Briggs And Stratton 395491 397358; IBS3002 picture

Ignition Coil For Briggs And Stratton 395491 397358; IBS3002

$40.22



Electric Coil Spiral Binding Machine 46 Holes Spiral Coil Book Binder with Coil picture

Electric Coil Spiral Binding Machine 46 Holes Spiral Coil Book Binder with Coil

$114.00



Heating Coil 5 PIN XLR 20mm 16mm 10mm flat 25mm 30mm Electronic picture

Heating Coil 5 PIN XLR 20mm 16mm 10mm flat 25mm 30mm Electronic

$34.99



Dental Orthodontic Niti Open Coil Spring Spool .008/010/012/014 Inch 914mm picture

Dental Orthodontic Niti Open Coil Spring Spool .008/010/012/014 Inch 914mm

$74.79







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