|
Discussion | « Back to Topics
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comments: 2 |
| code120 | | | 05.06.2012, 19:31:43
|
|
|---|---|---|---|
|
DosBox and Autohotkey - A short guide
Autohotkey is a program that can intercept inputs (from keyboard, mouse or even joystick) and send to the OS a different input, on the base of instructions coded in a script. This is useful for a lot of programs, like word processors, and it also allows to create keyboard shortcuts, or the use of mouse/joystick buttons and the mouse wheel, in programs that don't support them, like DosBox. Ahk can recognize the active window and the script can be made to affect a single program. You can therefore create a script that binds the mouse wheel or extra buttons to certain keys if DosBox is the active window. Even better, you can have different instructions (and different bindings) for most programs that are executed in DosBox, since Ahk can recognize a window also from its title bar (where the name of the .EXE launched in DosBox appears). Once the script has been created, if Ahk is installed and the script is executed, it will run in the background and it will affect only the kind of window (that is, the program) that has been secified in the script, without affecting the rest of the OS. You can create a script with the notepad, then save it with the .ahk extension and launch it with Autohotkey installed. ********************************************* An hotkey has the following syntax: [hotkey]:: [instruction] return Example: ^s:: Send hello Will write 'hello' if you press Ctrl+s ^s:: Send, {Enter}{Right}{Right}{Enter} Ctrl+s will correspond to the keys Enter, 2 x right arrow, Enter pressed in sequence. In the [hotkey] part you can use these symbols: ! Alt ^ Control + Shift ~ When the hotkey fires, its key's native function will not be blocked. * Wildcard: Fire the hotkey even if extra modifiers are being held down. Other symbols can be found here: http://www.autohotkey.com/docs/Hotkeys.htm#combo Here you find a comprehensive list of keys, mouse and joystick buttons that can be used in Ahk. http://www.autohotkey.com/docs/KeyList.htm The [instruction] part consists mostly in SendEvent (or Send) commands. Here special keys must be enclosed in brackets. Here is a list of special keys used with SendEvent: http://www.autohotkey.com/docs/commands/Send.htm ************************************* An example of script that can be useful for DosBox: ************************************* ; The script is organized in blocks. Every block that starts with a #ifWinActive ; command will run independently form the others. More than 1 block (even all of ; them, if conditions are met) can run at the same time. SetTitleMatchMode, 2 ;/// this will make Ahk search the string stated in the #ifWinActive lines in ;/// the whole length of the title bar, allowing you to create shortcuts ;/// for nearly all DosBox programs you could want to create them for. #ifWinActive, ahk_class SDL_app ;/// this block will be active for every program run in DosBox, since it's the ;/// simple identifier for the DosBox window. I bound the key [,] and [.] ;/// to mouse wheel up and down. You can choose the key you want. ;/// It is better to bind keys that aren't commonly used, though, otherwise ;/// they could conflict with keys used by some programs. ;/// After you've bound the keys in the script, you'll have to bind them in ;/// DosBox, with Ctrl+F1 you can launch the keymapper, just choose the key ;/// you want to bind to the wheel, then press 'Add' and move the wheel ;/// when asked to press a key. *WheelUp:: SendEvent {, Down} Sleep 200 SendEvent {, Up} Return *WheelDown:: SendEvent {. Down} Sleep 200 SendEvent {. Up} Return ;\\\ XButton1 and XButton2 are two extra mouse buttons (Web back/forward) that ;\\\ can be found on certain mice. Here they're bound to Ins and Del keys. XButton1:: SendEvent {Ins Down} Sleep 200 SendEvent {Ins Up} Return XButton2:: SendEvent {Del Down} Sleep 200 SendEvent {Del Up} Return ;*********************************************** ; this block is active with Elders Scrolls: Daggerfall. #ifWinActive, Program: FALL ~*WheelUp:: SendEvent {v Down} Sleep 200 SendEvent {v Up} Return ~*WheelDown:: SendEvent {NumpadSub Down} Sleep 200 SendEvent {NumpadSub Up} Return ;*********************************************** ; this block is active with Wrath of Earth. It allows to change weapon with the ; mouse wheel. #ifWinActive, WOE ~*1:: Weapon := 1 ~*WheelUp:: Weapon := ++Weapon if Weapon = 8 { Weapon := 1 } SendEvent {%Weapon% Down} Sleep 200 SendEvent {%Weapon% Up} Return ~*WheelDown:: Weapon := --Weapon if Weapon = 0 { Weapon := 7 } SendEvent {%Weapon% Down} Sleep 200 SendEvent {%Weapon% Up} Return ;*********************************************** ; this block is active with Wizardry VI. #ifWinActive, WROOT WinWaitActive, WROOT ifWinActive, WROOT { XButton2:: Send, {Enter}{Enter} return RButton:: Send, {Enter} return z:: Send, {Enter}{Right}{Right}{Enter} return 1:: Send, {Enter}{Down}{Enter}{Down}{Enter} return 2:: Send, {Enter}{Down}{Enter}{Down}{Right}{Enter} return 3:: Send, {Enter}{Down}{Enter}{Down}{Down}{Enter} return 4:: Send, {Enter}{Down}{Enter}{Down}{Down}{Right}{Enter} return 5:: Send, {Enter}{Down}{Enter}{Down}{Down}{Down}{Enter} return 6:: Send, {Enter}{Down}{Enter}{Down}{Down}{Down}{Right}{Enter} return ^s:: { Send, {Enter} Sleep 50 Send, {Right} ;Sleep 50 Send, {Right} ;Sleep 50 Send, {Down} ;Sleep 50 Send, {Enter} Sleep 100 Send, {Enter} } return ^r:: { Send, {Enter} Sleep 100 Send, {Right}{Right}{Down}{Enter} Sleep 100 Send, {Down}{Down}{Enter} Sleep 100 Send, {Down}{Enter} } return } return ;*********************************************** ; this block is active with F117 Stealth Fighter II. #ifWinActive, VGAME ; F117 Joy17::Send {F1} Joy18::Send {Shift Down},{Shift Up} Joy19::Send {Shift Down}-{Shift Up} Joy20::Send {Shift Down}m{Shift Up} |
|||
![]() |
Lennejo | | Amberstar: PC vs Amiga version | 02.04.2009, 18:43:05
|
|---|---|---|---|
|
Is there any difference between PC and Amiga versions of the Amberstar? I'd like to get maximum pleasure from playing this, so which version would you recommend?
|
|||
| shows: 2 [ 1-2/2 ] | «previous | 0 | next» |
| articles |
| OldGames Information |
| OldGames Music / Radio |
| Emulators / Utils |
| FAQs |
| uPoints |
| Premium account |
| Statistics |
| categories |
| 3D-Action / FPS |
| Action |
| Adventure |
| Logic |
| Racing |
| RPG |
| Strategy |
| Simulation |
| Sport |
| Demo scene |
| Diskmags |
| Applications |
| search game by title | |
| search in magazines | |
| search everywhere | |
| help us to keep going | |
| last added games |
| NHL Hockey 95, 08.05.2013 |
| Eschalon: Book I, 08.05.2013 |
| Dual Orb II, 07.05.2013 |
| Lufia & the Fortress of Doom, 06.05.2013 |
| Outlaws, 24.04.2013 |
| Prokletí Eridenu, 20.04.2013 |
| Mortal Kombat II, 16.04.2013 |
| Corporation, 11.04.2013 |
| Resident Evil (Bio Hazard), 07.04.2013 |
| Sweet Home, 03.04.2013 |
| [ more games ] |
| new galleries |
| Eschalon: Book I [22], 10.05.2013 |
| NHL Hockey 95 [9], 09.05.2013 |
| Tactics Ogre: Let Us Cling Together [20], 08.05.2013 |
| Maniac Mansion Deluxe [27], 08.05.2013 |
| Dual Orb II [48], 03.05.2013 |
| Outlaws [5], 22.04.2013 |
| [ more galleries ] |
| stats | |
| Games | :: 1066 |
| Extras | :: 7830 |
| Comments | :: 5209 |