halflife icon indicating copy to clipboard operation
halflife copied to clipboard

[CS 1.6 - Request] Disable CTRL + <number> shortcut (switches workspace) on OS X

Open konschta opened this issue 13 years ago • 2 comments

Really annoying is the fact that on OS X CTRL + <Number> switches your workspace and minimises the game, which I guess happens a lot, e.g. during weapon switching while crouching. So it is perhaps a good solution to prevent CTRL + form working while ingame, if that is possible.

I already mentioned this in issue #229, where I also commented on some CMD + <key> shortcuts.

Hardware: MBP 13" mid 2010, OS X 10.8.2

konschta avatar Feb 21 '13 23:02 konschta

We have tried to do this on other products but we haven't found an Apple API to allow this. If you know how to programmatically cause this please chime in.

alfred-valve avatar Feb 21 '13 23:02 alfred-valve

@alfred-valve Not really, I found some workarounds, but I'm not sure if this is helpful.

  • http://stackoverflow.com/questions/5311459/disable-keyboard-shortcut mentions:
#import <Carbon/Carbon.h>
    void *oldHotKeyMode = PushSymbolicHotKeyMode(kHIHotKeyModeAllDisabled);
Make sure that you re-enable them with:
    PopSymbolicHotKeyMode(oldHotKeyMode);
  • http://stackoverflow.com/questions/6215201/catch-system-event-as-cmd-tab-or-spotlight-in-a-cocoa-app mentions:
#import <Carbon/Carbon.h>
void *oldHotKeyMode;
- (void)windowDidBecomeKey:(NSNotification *)notification{
    oldHotKeyMode = PushSymbolicHotKeyMode(kHIHotKeyModeAllDisabled);
}
- (void)windowDidResignKey:(NSNotification *)notification{
    PopSymbolicHotKeyMode(oldHotKeyMode);
}

and Event Taps: http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html

konschta avatar Feb 21 '13 23:02 konschta