Anyone willing to do a quick test with AutoHotkey?

Discussion in 'Software' started by lblb, Jan 19, 2016.

  1. lblb

    lblb Scribbler - Standard Member Senior Member

    Messages:
    1,187
    Likes Received:
    237
    Trophy Points:
    81
    Hi all,

    After some user requests, I'm trying to update some of the apps that I've shared around this forum. Several requests have to do with doing things automatically (starting/quitting programs, moving the taskbar, turning touch on/off, changing power plan, etc.) whenever a tablet is switched between tablet and desktop modes in Win 10, or when it's docked and undocked. Unfortunately, I don't have any tablet with Win 8/8.1/10 installed on which to test, so I was wondering if some of the kind souls here would be willing to test something. You will need to have AutoHotkey installed.

    Could anyone running Windows 8/8.1/10 (I'd in fact be interested in knowing how all three versions react), create a new AHK file and paste in the text below. If you then run the AHK file, you should hopefully see a message box that reports the "Slate/Not slate" and "Docked/Not docked" states whenever you switch between either of these modes. (You can stop it by right-clicking on the tray icon.)

    Thanks in advance for anyone willing to test this and give feedback! Hopefully should be pretty quick!


    Code:
    #SingleInstance force
    SetBatchLines -1
    
    SysGet, Slate_Mode_Init, 0x2003
    If (Slate_Mode_Init = 0)
    Slate_Mode = Slate
    Else
    Slate_Mode = Not slate
    
    SysGet, Dock_Mode_Init, 0x2004
    If (Dock_Mode_Init = 0)
    Dock_Mode = Not docked
    Else
    Dock_Mode = Docked
    
    Msgbox, Slate mode = %Slate_Mode%`nDock mode = %Dock_Mode%
    
    OnMessage(0x2003, "WM_SETTINGCHANGE")  ; React tablet mode change
    OnMessage(0x2004, "WM_SETTINGCHANGE")  ; React dock mode change
    Return
    
    WM_SETTINGCHANGE(wParam,lParam,msg)
    {
    If msg = 0x2003
    {
    If (lParam = 0)
    Slate_Mode = Slate
    Else
    Slate_Mode = Not slate
    }
    If msg = 0x2004
    {
    If (lParam = 0)
    Dock_Mode = Not docked
    Else
    Dock_Mode = Docked
    }
    Msgbox, Slate mode = %Slate_Mode%`nDock mode = %Dock_Mode%
    }
     
    Last edited: Jan 20, 2016
    thatcomicsguy likes this.
  2. Yoyo

    Yoyo Scribbler - Standard Member

    Messages:
    105
    Likes Received:
    40
    Trophy Points:
    41
    lblb-

    Just found your post, and ran the script. Sorry so late, I haven't been perusing this forum so much lately, since my tablets are working great...

    Anyway, I ran the script and got a message box:

    Slate mode = Slate
    Dock mode = Not docked

    I'm running an Asus VTN8, with Win 8.1.

    Thank you for your efforts! I'm using some scripts I cobbed together from people who've posted here, that have made my tablets much more useful- so likely I'm enjoying the benefits of your work.
     
  3. lblb

    lblb Scribbler - Standard Member Senior Member

    Messages:
    1,187
    Likes Received:
    237
    Trophy Points:
    81
    @Yoyo
    Very sorry for the late reply, I somehow completely missed your post.

    Thank you so much for testing it. What you report sounds good. Now if you have the script running and you change from slate to desktop mode, or from not docked to docked mode, does it automatically tell you that the mode was changed, and does it correctly identify the new mode?

    Thanks again for being willing to test this out!
     
  4. Yoyo

    Yoyo Scribbler - Standard Member

    Messages:
    105
    Likes Received:
    40
    Trophy Points:
    41
    I don't know how to do that. I'm running 8.1. Do docked or slate modes even exist in 8.1, and if so how would one manually toggle, and how would on know which mode he's in at a given time?
     
  5. lblb

    lblb Scribbler - Standard Member Senior Member

    Messages:
    1,187
    Likes Received:
    237
    Trophy Points:
    81
    Hi Yoyo,

    Of that's right, Slate/Desktop modes are only for Win 10. Sorry about that.

    For the docked/undocked modes, is there something like a dock (maybe it could also work with a detachable keyboard, maybe not...) with your tablet?
     
  6. Yoyo

    Yoyo Scribbler - Standard Member

    Messages:
    105
    Likes Received:
    40
    Trophy Points:
    41
    My model tablet was never available with a dock or keyboard. I use a generic bluetooth keyboard with it, but am not aware of it changing modes in any way when it connects.
     
  7. lblb

    lblb Scribbler - Standard Member Senior Member

    Messages:
    1,187
    Likes Received:
    237
    Trophy Points:
    81
    Sounds good. I think this means you did all the tests that were possible with your tablet. Thanks much, that's very valuable information. I really appreciate it.

    Cheers!
     
Loading...
Similar Threads - Anyone willing quick
  1. bloodhand
    Replies:
    0
    Views:
    1,108

Share This Page