| Main > Main Forum |
| Shut Down Windows with Joystick? |
| << < (3/3) |
| bkenobi:
Does that last script send the escape key to MAME correctly? I wasn't aware that you could send keys from AHK to MAME with the RAW input system. If it works, that would be really nice to know! I was pretty sure you needed to compile MAME with the RAW input system disabled, but of course if this does work then I'm wrong! :cheers: |
| allroy1975:
I was just reading in another long winded thread about "new versions of mame only take raw input" or something when talking about passing coin input from a FE to the mame exe. That was the first I had heard of it. I was running into speed issues with the newer versions of mame, so I dropped back to like .85 and it seems to be working fine. but..in older versions (where you can skip the legal info and rom info :applaud: ) it seems to work. you should be able to replace "Joy1" with anything. A key on the KB or whatever. I was going nuts last night with this...instead of using {Esc Down} I was sending it like... 500 escape keypresses..sometimes it would work and sometimes it wouldn't. I was going nuts. then i remembered the down (holds the button down) and bam. success. I love figuring stuff like that out..but I wasted literally HOURS trying to do it the wrong way. :dizzy: |
| bkenobi:
Yes, this will work with versions of MAME older than ~0.117. If you try it with versions more recent than that, you will not see any input to MAME from the AHK script unless you compile your own version of MAME to not use the RAW input scheme. I was just making sure things hadn't been changed somehow. Thanks for the response! 8) |
| allroy1975:
now...I don't know what I'm talking about...but this AHK script is REALLY cool in my opinion. I always have kids...(and some adults ::) ) pushing buttons all over the place. I usually set up button combo's to do admin features. That way only I can access them. Unfortunately someone will hit the same buttons I have set up. So having a script that says you have to do something for X seconds seems like a more stable options. People don't set their drinks down...ON BUTTONS! so...I don't know if this would work, but AHK does have a SendRaw option. I haven't tested but it's simply adding 3 more characters to the script: --- Code: ---~Joy1:: tt=0 ; set time to 0 loop,10000 ; check every 10 seconds { GetKeyState, state , Joy1, p if state=U Break tt+=30 sleep 30 } if tt>5000 ; if key pressed more than 5 secs { IfWinExist, MAME WinActivate SendRaw {Esc Down} sleep 1000 run, shutdown -s -t 00 } return --- End code --- any idea if that would work on newer mame builds? |
| Navigation |
| Message Index |
| Previous page |