 |
 |
Fetching global key events
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
I'm currently writing a MenuExtra and I want to create shortcuts for some items. But it won't work using the "keyEquivalent:@"G"];" parameter. How can I do this ? One solution I found is that I could use the carbon GetKeys method in a timer (GetKeys returns just the keycode, so I would have to implement different keymappings by myself). But I think there's a much more elegant way to assign a shortcut to a global menu, or ?
Short: I would like to have access to the global event queue and check it for key events and maybe create some virtual events ...
Mahrz
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Admin Emeritus 
Join Date: Oct 2000
Location: Boston, MA
Status:
Offline
|
|
What about Carbon HotKeys (like what LaunchBar uses)?
|
|
"Against stupidity, the gods themselves contend in vain" (Schiller)
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
Originally posted by parallax:
<STRONG>What about Carbon HotKeys (like what LaunchBar uses)?</STRONG>
Well, sounds good, do you know a link to a documentation (I don't know Carbon HotKeys and I'm currently sitting at a pc in school, so I have no access to my docs and can't download source ) ?
But this is no answer to my other question, how to create "virtual" events so that the system thinks that the user pressed a shortcut to copy/eject cd, pressed some keys or something like that ? Can anybody help me .... ?
Mahrz
[ 02-12-2002: Message edited by: mahrz ]
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
Originally posted by mahrz:
<STRONG>
Well, sounds good, do you know a link to a documentation (I don't know Carbon HotKeys and I'm currently sitting at a pc in school, so I have no access to my docs and can't download source ) ?
</STRONG>
Ok found it at apple dev doc .... Sorry for the stupid question ...
But I'm still searching a way to create globals events
Mahrz
[ 02-12-2002: Message edited by: mahrz ]
[ 02-12-2002: Message edited by: mahrz ]
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
Originally posted by mahrz:
<STRONG>...
But it won't work using the "keyEquivalent:@"G"];" parameter.
...
</STRONG>
do you mean: "this doesn't work" or "this is not what i want in my app"?
if it was the former, you are aware of the fact that "G" equals command-SHIFT-g, right? if you just want command-g, use "keyEquivalent:@"g"];"
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
Originally posted by seb2:
<STRONG>
do you mean: "this doesn't work" or "this is not what i want in my app"?
if it was the former, you are aware of the fact that "G" equals command-SHIFT-g, right? if you just want command-g, use "keyEquivalent:@"g"];"</STRONG>
It doesn't work ..., you can see the shortcut but nothing happens if you press the keys.
I'll test the carbon hotkeys they look like what i wanted ...
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
Originally posted by parallax:
<STRONG>What about Carbon HotKeys (like what LaunchBar uses)?</STRONG>
I figured out how these HotKeys work. My MenuExtra registers a carbon event handler and the hotkey. But then I have to start the carbon event loop !
If i start the carbon event loop my MenuExtra recognizes the hotkey but i can't move any MenuExtra anymore !
[ 02-12-2002: Message edited by: mahrz ]
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
Edit: nevermind.
Why did I bump this?! Pay attention, me!
(Last edited by Wevah; Sep 3, 2003 at 05:42 PM.
)
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|