Close
Showing results 1 to 3 of 3
  1. #1

    Default Scripting with AutoHotkey (would like some help)

    Hi I'm trying to make a simple world of warcraft keycloning script that clones every key on the board (mostly) as well as modifier keys (shift, alt, ctrl). I'm currently having the hardest time figuring out how to use modifiers with this script. Baically I would like to be able to use all letters a-z and numbers 0-9 as well as mouse button 4 and 5 with each modifier. I don't know if I can simply put the modifier key into the code and put each other key separately or if i have to combine them in each instance, for example shift-a would translate into A in both windows.

    Here is my current script for the modifier keys, at the present time it works only to make the main window be affected by modifiers (I hold shift and press R and the main window types it but the off window times absolutely nothing)

    I'll also attach my full script (since it is too long)


    Code:
    ~LShift:: KeyWait,LShift, D 
    {
    ControlSend,, {LShift}, ahk_id %wowid1%
    ControlSend,, {LShift}, ahk_id %wowid2%
    Return 
    }
    
    
    WinGet, wowid, list, World of Warcraft 
    
    
    ~Lalt:: 
    KeyWait, Lalt, D 
    IfWinActive, World of Warcraft 
    { 
    ControlSend,, {Lalt}, ahk_id %wowid2% 
    Return 
    }
    
    
    WinGet, wowid, list, World of Warcraft
    
    
    ~Lctrl:: 
    KeyWait, Lctrl, D 
    IfWinActive, World of Warcraft 
    {
    ControlSend,, {Lctrl}, ahk_id %wowid2%
    Return 
    }
    
    
    
    WinGet, wowid, list, World of Warcraft


    Also if anyone knows the code for the tilde key ( ~ ) as well as mouse button 4 and mouse button 5 that would be grand!
    Attached Files Attached Files
    Last edited by MiRai : 09-10-2012 at 10:25 AM Reason: Fixed Text Color

  2. #2

    Default

    You can lookup AHK help file Contents->Hotkeys for usage of modifiers.

    For example,

    To use more than one modifier with a hotkey, list them consecutively (the order does not matter). The following example uses ^!s to indicate Control+Alt+S:

    Code:
    ^!s::Send Sincerely,{enter}John Smith  ; This line sends keystrokes to the active (foremost) window.return
    For R and Shift-R, I will include the following codes

    Code:
    ~R:: .....              ; R 
    
    ~+R:: ....             ; shift R
    Can't you use ` hotkey instead of ~ ?

    Button 4 & 5? Not sure, but you can look under KeyList. I found XButton1 and XButton2.

    BTW, there is a gaming forum under AHK site. You may have more lucks over there.

  3. #3

    Default

    This would probably work for Shift + R hotkey.
    Code:
    ~+R::
    KeyWait,R, D     ;optional
    {
          ControlSend,, {LShift down}{r}{LShift up}, ahk_id %wowid1%
          ControlSend,, {LShift down}{r}{LShift up}, ahk_id %wowid2%
    }
    Return

    For mouseclicks I personally use the mouse software to re-direct it to a new hotkey. e.g Mousebutton4 -> CTRL+DEL. Then I just make a script for ^DEL:: in AHK.

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •