Author
|
Topic: using both keyboard and mouse
|
Tamtur |
posted 07-13- 03:01 PM CT (US)
By keeping the mouse enabled, evidently it shuts out the keyboard commands - dink doesn't even 'see' the key being pressed; it doesn't look for the 'key- ' file. Does anyone know a way to be able to use both - or if there is a way? I can always change sprite 1's brain to 1 and freeze it when I need keyboard input, but I'd like to be able to have keyboard shortcuts at any time. Thanks
|
FF4LIFE
|
posted 07-15- 01:20 AM CT (US)
It works for me. In the start button script i put this:set_keep_mouse(1); then when i want dink to be a mouse(My status screen) I put this: sp_seq(1, 0); sp_brain(1, 13); sp_pseq(1,10); sp_pframe(1,8); sp_noclip(1, 1); sp_que(1, 1600); sp_x(1, 1); sp_y(1, 1); sp_base_walk(1, -1); sp_base_idle(1, -1); sp_base_attack(1, -1); Simple as that!
|
Tamtur
|
posted 07-15- 01:40 AM CT (US)
Huh. That's exactly what I did, but for some reason my keyboard only works when the mouse isn't enabled. Hitting escape doesn't even work to bring up the menu when dink is the mouse. Well, if you have any ideas.... |
FF4LIFE
|
posted 07-15- 11:14 AM CT (US)
Thats truly odd....sorry, can't help you. |
Phoenix
|
posted 07-15- 03:28 PM CT (US)
I'm not sure if you've noticed, but when you turn DINK into a mouse pointer, then how are you supposed to control Dink?No, you can't have Dink walking around/hitting/etc. while having a pointer at the same time. |
Tamtur
|
posted 07-16- 01:35 AM CT (US)
ff - When you are on your status screen, with Dink as the mouse, does the keyboard work?Phoenix, what I am talking about is pressing a key on the keyboard (such as escape) to have the program look for the 'key-68.c' file or whatever key I just pressed. In the original Dink game, you can press 'P' and hear a pillbug squeal. For some reason this isn't working for me while Dink is the mouse. |
Beuc
|
posted 07-16- 11:21 AM CT (US)
When I'll get time to set up again all my files (got a problem last times), and thus also Dink, then I'll try this :) The best should be to start with a new skeleton DMod, and then mess up with all the things in start.c |
Phoenix
|
posted 07-16- 05:42 PM CT (US)
I think that as long as Dink is a pointer, every key-press is ignored. I think. ;) |
FF4LIFE
|
posted 07-19- 08:59 AM CT (US)
I'm pretty sure thats the case also...what exactly are you trying to do? I might be able to give suggestions... |
Tamtur
|
posted 07-19- 12:06 PM CT (US)
I'm creating a program with cryptograms - you know, where the letters are substituted with different letters and you have to figure out the saying by the letter patterns. The typing comes in because I want them to be able to click on a substituted letter then type the letter they think it is, and have the letter appear a little above the original letter. I tried void wait_for_button() (instead of having a different script for each letter) and it worked, but it seemed to only see everything but letters. If I change the brain of the mouse to 1, it automatically becomes dink idle and all the letter sprites turn into purple squares. I haven't tried changing it into a different brain. The other option is to have a row of letters at the bottom and they can click one of them then click the letter it belongs to. That seems like it will be easier. Suggestions? Thanks |
FF4LIFE
|
posted 07-20- 01:48 AM CT (US)
Hrm....i suppose you can just make an extra button for each letter, that'll work. This kind of reminds me of something i did...i have it so when you click on a sprite, it turns dinks brain to 0, turns freeze(1) on, tho i don't know if that does anything, and then gives you a choice command. It works, it freezes the mouse and then you use the arrow keys to choose a response. Try making dink's brain 0 then having a wait for button. |
Tamtur
|
posted 07-20- 12:46 PM CT (US)
Well, your idea works in a way - the wait_for_button command sees the 'escape' key and the arrow keys but not letters or numbers. Maybe the command itself is not programmed to see letters as the type of button that it's looking for - maybe due to possible conflicts with 'key-' scripts? I think that I'll just make alphabet buttons across the bottom. If you have a better idea, let me know. |
Drakeman
|
posted 07-20- 07:54 PM CT (US)
Tamtur I think you're right. For the riddle script I first wanted to have the player type the answers... but their are only a certain number of keys that return values... I think 5 and 6 are one of them, though I don't know why... but SHIFT, CTRL, ENTER, ESCAPE, and ARROW KEYS are the important ones. So in the end I created a box of letters that a sprite moves around in response to ARROW keys. I never thought of using the mouse and having button sprites for each letter, but there is no reason that should not work. |