Key Config Dialog, EventTypeSpec, etc.

dave05
Unregistered
 
Post: #1
Hi,

I'm working on a game written in Carbon/C, and I've come to the point where I want a dynamic key-configuration dialog.

I'm familiar with SOME EventTypeSpecs and how to use them, but I'm not sure how to do everything I'd like to...

here's some stuff i need help with. any help is very much appreciated as always.

1) recognize check box clicks, disable text boxes.

for example, I have a check box which is titled "Mouse X Controls Turning". When this is checked, I want the user to be unable to define the "Turn Left" and "Turn Right" keys... does anybody know what the event Type/Class pair is for a checkbox event? I suppose i could set up a command string such as 'mtrn' and check kEventProcessCommand command.commandID, but I'm not sure this would work. As for how to disable the text boxes from the code level, I have no idea. I have very little understanding of "GetControlByID" and have no idea how to actually modify controls based on events.

2) change "small static text" contents.

This is basically the same problem I'm having with disabling the text boxes. I'd like to know how to change small static text fields beside each key config text box. These text fields are not configurable by the user, but they should be alterable using code. The basic progression I want is as follows:
a. the user clicks the text box, and its contents are automatically "select-alled" (selected)
b. the user types a non-standard key such as "option"
c. the text box fills with a space, and the static text field changes from "empty" or "invisible" (ie the empty string, or an invisible text field)
d. the contents of the text box are re-selected so that another keystroke will re-configure the key.
e. if the user configures to a standard key like 'M' then the static text field is hidden or emptied again.

That's all I really need to be able to do for now. I'll continue my search on google for Carbon Event Handling documentation, but it seems to be ... incomplete wherever I discover it. I know I should be using Cocoa, but.. honestly, 95% of even the programming population doesn't use Cocoa, so screw it.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
My guess is you'll have to read the documentation Rasp

The header file for Carbon Events or the controls will tell you which events are fired by which controls at which moments. The header file for the controls will tell you how to enable/disable and change the text. There might be a decent overview somewhere in the Carbon docs, but personally I'd just read the headers for that kind of detailed usage information.

(This would be dead easy in Cocoa)
Quote this message in a reply
Post Reply