 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Rory
Joined: 04 Jul 2007 Posts: 4
|
Posted: Wed Jul 04, 2007 4:44 pm Post subject: Script working when emulator is windowed but not fullscreen. |
|
|
Sorry to ask such a newbie question but I've trawled over the quick start docs and the FAQs and searched the forum for help on this and I'm getting nowhere fast. Basically I want to the keys ALT+f, followed by the down arrow, followed by the enter key sent to an Acorn Archimedes emulator called Arculator (http://b-em.bbcmicro.com/arculator/) when I press n on the keyboard. Very, very basic stuff I know.
The code below works perfectly when the emulator is running in a window.
SendMode Input ;
n::
Send, {ALTDOWN}f{ALTUP}{down}{enter}
return
But running fullscreen all that happens is that the n key is disabled. So far I've tried adding the lines of code below as suggested elsewhere on the forum.
SetKeyDelay, , 19
Pause::Pause
Where it says 19 I've tried various other numbers from 0 upwards and that makes no difference. I've tried using SendPlay instead of Send and I've changed the SendMode to Play and Event instead of Input. I've also tried the code below which uses the ControlSend command, the title of the emulator's window is "Arculator v0.8 - 100% - Click to capture mouse" as can be seen from the code.
n::
WinWait, Arculator v0.8 - 100`% - Click to capture mouse
WinActivate
ControlSend, , {ALTDOWN}f{ALTUP}{down}{enter}, Arculator v0.8 - 100`% - Click to capture mouse
return
It may be I've made mistakes but the above code doesn't work in windowed or fullscreen mode. At this point I'm not exactly ready to give up (much too stuborn!) but I am ready to accept any help that's going and follow any suggestions that anyone might have. Thanks in advance. |
|
| Back to top |
|
 |
SanskritFritz
Joined: 17 Feb 2005 Posts: 283 Location: Hungary, Budapest
|
Posted: Wed Jul 04, 2007 10:06 pm Post subject: |
|
|
You could try
#InstallKeybdHook _________________ Is there another word for synonym? |
|
| Back to top |
|
 |
Peter
Joined: 30 Dec 2005 Posts: 279
|
Posted: Wed Jul 04, 2007 10:16 pm Post subject: |
|
|
AHK Help mentioned this | Quote: | | ControlSend is generally not capable of manipulating a window's menu bar. To work around this, use WinMenuSelectItem. |
At least code below works for me: (not same function as yours, just some testcode for me)
| Code: | F10:: ; to activate when Arculator window is active
WinGet, WinID, id, A
WinMenuSelectItem, ahk_id %WinID%,, File, Exit ; make Arculator to exit also at full screen
Return
F11::ExitApp
Return
|
|
|
| Back to top |
|
 |
Rory
Joined: 04 Jul 2007 Posts: 4
|
Posted: Thu Jul 05, 2007 12:00 pm Post subject: |
|
|
Thanks a lot for the replies. Just to clarify my main system runs Windows 98 and Arculator v0.8 but I have a laptop running XP and Arculator v0.9 (latest version). Both systems have the latest version of Auto Hot Key.
Ok, with that out of the way I've tried the code Peter posted on both my main system and on my laptop and got the same results. While Arculator is in Windowed mode pressing F10 shuts down the emulator successfully but while it's in full screen mode pressing F11 has no effect at all.
Does your version of Arculator close in full screen when you press F11 Peter? Just checking I've understood your code correctly.
In the meantime I'll try and write a script using #InstallKeybdHook on my laptop ( as this particular command doesn't work on Windows 98 ). I'll post the results along with the script that I come up with.
Again, thanks to both of you for taking the time to reply. |
|
| Back to top |
|
 |
Rory
Joined: 04 Jul 2007 Posts: 4
|
Posted: Thu Jul 05, 2007 4:22 pm Post subject: |
|
|
Sorry, I was being stupid. Peter's script does close Arculator while it's full screen on Windows XP if you press F10, unless you press F11 first in which case F10 does nothing. If you remove the last 2 lines of Peter's code it works just as well. I realise the last 2 lines are used to close the AHK script after it has run but you could remove those lines and put the ExitApp command higher up the script like this to get the same result.
F10:: ; to activate when Arculator window is active
WinGet, WinID, id, A
WinMenuSelectItem, ahk_id %WinID%,, File, Exit ; make Arculator to exit also at full screen
ExitApp
Return
Anyhow the problem I now have is that the script won't work on Windows 98. Does anyone know if there are any commands in the script that are Windows XP only? |
|
| Back to top |
|
 |
Peter
Joined: 30 Dec 2005 Posts: 279
|
Posted: Thu Jul 05, 2007 7:03 pm Post subject: |
|
|
| Rory wrote: | put the ExitApp command higher up the script like this to get the same result.
| As I said the script was for testing, that's why included "F11::ExitApp" to close the script after testing, i.e. for easy script exit during test.
Unfortunately, my Win98 PC gives an error on Arculator.
But that's probably because I use that Win98 PC only for some testing, I have to reinstall some day to have a properly working Win98 PC. |
|
| Back to top |
|
 |
Rory
Joined: 04 Jul 2007 Posts: 4
|
Posted: Fri Jul 06, 2007 10:07 am Post subject: |
|
|
Thanks a lot for the reply Peter, please don't think there's something up with your Win98 PC because it gives an error on the latest version of Arculator (version 0.9a), I've tried it on 3 different Win98 systems and it won't work on them either . Sometimes the program freezes, sometimes the whole system does. Version 0.8 however works perfectly on Win98 . If you have the spare time it can be found at http://b-em.bbcmicro.com/arculator/arcul08.zip. Again, thanks for all the help. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|