AGI1122 |
For some reason I can't seem to get it to detect whether or not certain keys are pressed.
I used this:
(case evkeyboard
(if (== message key_t or == message (| key_t $20))
(= game_running false)
)
) and when I pressed t it would make the game stop running but when I use key_up and any other keys of that nature it would not work. I am trying to get the ego to move using this method but can't seem to get it to work.
|
AGI1122 |
*bump* I really need to figure this out. I have been able to get the ego to be controlled by the mouse but can't seem to set it up to check for these keys. Please help!!! |
Brian_Provinciano |
I must have some of the key codes incorrect. I believe I just took the PC ones and imported them into SCI Studio. SCI must use different keycodes then. Write a routine to print the character pressed on the screen in hex (%x) and you'll have a keycode. |
AGI1122 | Alright I will try that. |
AGI1122 | Yeah some of your key codes are incorrect. The up key is supposed to be $4800 and the keys.sch sets it to $26 and the key_(numbers) and the key_numpad(numbers) are backwards and need to be switched. I will go through all the keys myself and make sure they are correct then put out a correct version of keys.sch for use in SCI games. |
AGI1122 |
Well I have posted the corrections in this board. I guess this is just one more step before I can get my template game done. I will release an updated keys.sch and scc.sch when I release the template game. I guess it's time to get to work on making the ego controllable by the keyboard. Then I need to get a good default ego character... I also have a question about the mouse, am I able to get the game to tell the difference between a left click and a right click? I tried using the hex thing to find out but it kept printing out $0 or a NULL. I know that Quest for Glory 1 original used the right mouse button for descriptions on the screen. But what is the hex code for it? |
Lars Skovlund |
Strictly speaking, you shouldn't be using the key codes for the cursor keys explicitly. Instead you should use the kernel function MapKeyToDir. This gets you two advantages: 1. No assumptions about the used keyboard driver (Sierra SCI had keyboard drivers for Tandy keyboards as well as the usual ones, which probably mapped these keys differently. FreeSCI always returns the usual mappings.) 2. Instant support for joysticks. Nowadays, (2) is the most important point, of course. |