Keys I Can Use In Games

Sage
Posts: 1,066
Joined: 2004.07
Post: #1
Are there any keys on the keyboard that I CANNOT use when assigning keys for controls in my game?
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #2
power
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #3
Very nice Smile. But seriously, am I able to use all the other buttons.
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #4
as far as I am aware of
Quote this message in a reply
Moderator
Posts: 130
Joined: 2002.04
Post: #5
But you should consider stuff like not using Fkeys(becouse of the powerbook thing), and not keys you easily do other stuff with(I remeber a FPS game where you ran with the command key and switched weapons with the Q buttonÖ It didn't work too good.)

"Gameplay Uber Alles. And if you can make it psychedelic too, great!" - Jeff Minter
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #6
Alright thanks.
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #7
I read somewhere (here? CMG?) that Cocoa has problems if you press CMD+an arrow key (the arrow key gets "stuck")
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #8
actually it is command and any key. but this is only a problem if you input keys a certain way (namely ignoring modifers). I believe arekkusu has the fix for said problem
Quote this message in a reply
Member
Posts: 338
Joined: 2004.07
Post: #9
Some issues I've ran into:

Powerbooks also don't have a separate keypad. Yes, you can hit numlock and use 789-uio-jkl on your keyboard, but it doesn't feel right at all. If you map controls to the keypad, make sure you mirror them to the arrow keys (or just let the player change them.)

You can only have 2 keys pressed simultaneously on your keyboard. The third doesn't register at all. Keys that DON'T count toward this are F-keys, arrow keys and the keypad.

Justin Ficarrotta
http://www.justinfic.com
"It is better to be The Man than to work for The Man." - Alexander Seropian
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #10
You can fix the Cmd key problem in Cocoa if you subclass NSApp and override sendEvent. I think the thread for that got lost in the downtime, but the code is in Shoot Things if anyone needs it.

So, you can use any key, but you should be aware that not all keyboards have all keys. F13 F14 F15, for example. Or Ã’ is a key on a Spanish keyboard but a dead key combo on a US keyboard.

The number of simultaneous keypresses that register varies depending on the keyboard. It's two on old machines, eight on my powerbook.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #11
arekkusu Wrote:You can fix the Cmd key problem in Cocoa if you subclass NSApp and override sendEvent. I think the thread for that got lost in the downtime, but the code is in Shoot Things if anyone needs it.
Yeah, I think that thread is toast. Here's a quick code snippet to fix the command key-up issue.

Code:
// -paste this anywhere in your Cocoa code
// -to override NSApplication use the Target's inspector to set Principle Class:
// to KeyUpOverride
// -return it to NSApplication if this is removed

@interface KeyUpOverride : NSApplication {
}

@end

@implementation KeyUpOverride

- (void)sendEvent:(NSEvent *)anEvent
{
    if( [anEvent type] == NSKeyUp )
    {
        [[[self mainWindow] firstResponder] tryToPerform:@selector(keyUp:) with:anEvent];
        return;
    }
    [super sendEvent:anEvent];
}

@end
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Spaces on Snow Leopard and ctrl/arrow keys GolfHacker 19 15,310 Dec 4, 2012 03:18 PM
Last Post: bmantzey
  Multiple Keys down in SDL silver9172 2 4,873 May 30, 2009 06:16 PM
Last Post: scgames
  [NSEvent keyCode] to actual keys? teknein 8 9,448 Sep 5, 2007 07:27 AM
Last Post: teknein
  Keys ......again Coin 7 6,269 Jan 29, 2005 09:38 PM
Last Post: belthaczar
  Configurable keys - describe key that was pressed MattDiamond 13 7,232 Oct 27, 2003 11:23 PM
Last Post: OneSadCookie