Silently send Shift+Left to VLC

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Silently send Shift+Left to VLC

22 Jan 2015, 21:12

I am stuck like a newbie, and I tried a lot of ways (postmessage, sendmessage, lparam, more sleep, etc)...
The problem is the combo key "shift+left", else to send "space" works fine.

Code: Select all

#NoEnv
#SingleInstance Force
DetectHiddenWindows, On
SetTitleMatchMode, 2

WM_KEYDOWN := 0x100
WM_KEYUP := 0x0101
VK_SPACE := 0x20
VK_SHIFT := 0x10
VK_LEFT := 0x25
return

F8::
SendMessage, % WM_KEYDOWN, % VK_SPACE,,, VLC
sleep 50
SendMessage, % WM_KEYDUP, % VK_SPACE,,, VLC
return

F9::
SendMessage, % WM_KEYDOWN, % VK_SHIFT, ,, VLC
sleep 50
SendMessage, % WM_KEYDOWN, % VK_LEFT, ,, VLC
sleep 50
SendMessage, % WM_KEYDUP, % VK_LEFT, ,, VLC
sleep 50
SendMessage, % WM_KEYDUP, % VK_SHIFT, ,, VLC
return
Thank in advance !
jpginc
Posts: 124
Joined: 29 Sep 2013, 22:35

Re: Silently send Shift+Left to VLC

22 Jan 2015, 21:49

checkout ControlSend http://ahkscript.org/docs/commands/ControlSend.htm

when I tried this {shift down} didn't work for me, I had to use {lshift down} (which uses the left shift key). It could be the reason your script isn't working. perhaps try VK_LSHIFT := 0xA0

Code: Select all

f9::
{
    controlsend, , {lshift down}{left}{lshift up}, ahk_class QWidget
    if(errorlevel) 
    {
        msgbox error
    }
    return
}
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: Silently send Shift+Left to VLC

22 Jan 2015, 21:56

Side note. Jump back/forward doesn't work on media that doesn't show elapsed/remaining time.
garry
Posts: 3760
Joined: 22 Dec 2013, 12:50

Re: Silently send Shift+Left to VLC

23 Jan 2015, 02:56

Code: Select all

SendMessage, % WM_KEYDUP, % VK_SPACE,,, VLC
a failure (?)
shoul'd be WM_KEYUP
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: Silently send Shift+Left to VLC

23 Jan 2015, 17:12

Thank you jpginc, TLM, garry !

I gave up with postmessage and sendmessage, I guess I have to use keybd_event MSDN function, but not time for investigate...
Therefore I use controlsend for only one VLC window... (when I played with DetectHiddenWindows and SetTitleMatchMode at default value I had weird bug, and I can't replicate...)
Anyway, too tired with too much tries (and bad copypaste), thank again for your good eyes and your advices !
garry
Posts: 3760
Joined: 22 Dec 2013, 12:50

Re: Silently send Shift+Left to VLC

23 Jan 2015, 17:27

thank you , Zelio
here a vlc videolan example with ActiveX VideoLAN.VLCPlugin.2 , manage music/video-files , radio-streaming , youtube ... , skip-time , goto-time ...

http://ahkscript.org/boards/viewtopic.p ... 422#p35505

;---- use in Menu / Test foto/video/music/Youtube/TV examples , path for test-files c:\test\mp4 ... \mp3\jpg
;.... works with XP 32-bit und AHK_L
;.... needs ActiveX and uses vlc.exe http://nightlies.videolan.org/
;.... Gui,2:Add,ActiveX, x%xv% y%yv% w%wv% h%hv% vVlcx, VideoLAN.VLCPlugin.2

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Joey5, LepG, mcd, NullRefEx and 125 guests