Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Ken Thomases
On Jan 4, 2014, at 3:58 PM, Alex Hall wrote: > //store a keystroke > NSUInteger key=[event keyCode]+[event modifierFlags]; This isn't safe. The documented device-independent modifier flags are all in the high 16 bits of a 32-bit value, but there are other flags in the other bits. At the very

Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Alex Hall
On Jan 4, 2014, at 2:14 PM, Steve Mills wrote: > On Jan 4, 2014, at 10:13:46, Alex Hall wrote: > >> Yes, I can do it, but it seems like there must be a more efficient way than >> or-ing every combination of those five masks with the modifier flags each >> keypress contains. I can't be the fi

Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Jerry Krinock
On 2014 Jan 04, at 11:14, Steve Mills wrote: > There ya go, 2 shorts make UInt32. Yes, except unless you’re doing this for fun, I wouldn’t get down to the bit level because this code, which is somewhat tedious (conversions between Carbon and Cocoa key codes come to mind), has already been wri

Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Steve Mills
On Jan 4, 2014, at 10:13:46, Alex Hall wrote: > As I build the map and the rest of the game engine, I'll need to detect and > match up keystrokes. I want the user to be able to define these if they want > to, plus I know there has to be a better way to store them than hard-coded in > a bunch o

Another best practice question: storing hotkey assignments

2014-01-04 Thread Alex Hall
Hello list, I'm happy to say my audio game is now working. The game itself is not written yet, but the audio menu is doing well - I can navigate it with the arrow keys and the proper selector is called when I press enter. Thanks again for all your help thus far. As I build the map and the rest