AutoHotkey Community

It is currently May 27th, 2012, 10:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: July 6th, 2009, 3:11 pm 
Offline

Joined: July 6th, 2009, 3:10 pm
Posts: 3
Hi
I have in config file AHK code as below, everything is ok, but with one aplication Video lan player (VLC) was wrong.When i move window this program (VLC) i always come on window "open capture device" because in VLC for this action is shortcut CTR+C(in VLC i not see option change/off this action).Is possible turn off this action for VLC in code AHK?
Code:
[size=9]#z::Run www.autohotkey.com

^!n::
IfWinExist Untitled - Notepad
   WinActivate
else
   Run Notepad
return

+++++I PASTE YOUR CODE HERE+++++

; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded.  So feel free to customize it to suit your needs.

; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks.  It also explains more about hotkeys.
;Auto copy clipboard
~Lshift::
TimeButtonDown = %A_TickCount%
; Wait for it to be released
Loop
{
   Sleep 10
   GetKeyState, LshiftState, Lshift, P
   if LshiftState = U  ; Button has been released.
      break
   elapsed = %A_TickCount%
   elapsed -= %TimeButtonDown%
   if elapsed > 200  ; Button was held down long enough
   {
      x0 = A_CaretX
      y0 = A_CaretY
      Loop
   {
     Sleep 20                    ; yield time to others
     GetKeyState keystate, Lshift
     IfEqual keystate, U, {
       x0 = A_CaretX
       y0 = A_CaretY
       break
     }
   }
   if (x-x0 > 5 or x-x0 < -5 or y-y0 > 5 or y-y0 < -5)
   {                             ; Caret has moved
      clip0 := ClipBoardAll      ; save old clipboard
      ;ClipBoard =
      Send ^c                    ; selection -> clipboard
      ClipWait 1, 1              ; restore clipboard if no data
      IfEqual ClipBoard,, SetEnv ClipBoard, %clip0%
   }
      return
   }
}

~LButton::
TimeButtonDown = %A_TickCount%
; Wait for it to be released
Loop
{
   Sleep 10
   GetKeyState, LButtonState, LButton, P
   if LButtonState = U  ; Button has been released.
      break
   elapsed = %A_TickCount%
   elapsed -= %TimeButtonDown%
   if elapsed > 200  ; Button was held down too long, so assume it's not a double-click.
   {
      MouseGetPos x0, y0            ; save start mouse position
      Loop
   {
     Sleep 20                    ; yield time to others
     GetKeyState keystate, LButton
     IfEqual keystate, U, {
       MouseGetPos x, y          ; position when button released
       break
     }
   }
   if (x-x0 > 5 or x-x0 < -5 or y-y0 > 5 or y-y0 < -5)
   {                             ; mouse has moved
      clip0 := ClipBoardAll      ; save old clipboard
      ;ClipBoard =
      Send ^c                    ; selection -> clipboard
      ClipWait 1, 1              ; restore clipboard if no data
      IfEqual ClipBoard,, SetEnv ClipBoard, %clip0%
   }
      return
   }
}
; Otherwise, button was released quickly enough.  Wait to see if it's a double-click:
TimeButtonUp = %A_TickCount%
Loop
{
   Sleep 10
   GetKeyState, LButtonState, LButton, P
   if LButtonState = D  ; Button has been pressed down again.
      break
   elapsed = %A_TickCount%
   elapsed -= %TimeButtonUp%
   if elapsed > 350  ; No click has occurred within the allowed time, so assume it's not a double-click.
   {
      ;MouseClick, Left
      return
   }
}
; Since above didn't return, it's a double-click:
   Sleep, 100
   Send, ^c
return[/size]


Last edited by yzihs on July 18th, 2009, 6:50 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2009, 12:06 am 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
Something like:
Code:
#IfWinActive ahk_class VLC ;find the real ahk_class of VLC using Window Spy
^c:: return
#IfWinActive


:?:
________
Juggalo


Last edited by lilalurl.T32 on February 11th, 2011, 10:12 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2009, 6:52 am 
Offline

Joined: July 6th, 2009, 3:10 pm
Posts: 3
unfortunately, not work; look on first post where i paste your code.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2009, 3:35 pm 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
Have you used Window Spy to check the correct class of VLC, as I indicated in the code comment?
________
FORD TORINO


Last edited by lilalurl.T32 on February 11th, 2011, 10:16 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2009, 7:07 pm 
Offline

Joined: July 6th, 2009, 3:10 pm
Posts: 3
Window spy(VLC):
Code:
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
VLC media player
ahk_class QWidget

MediaPlayerClasic (ctrl+c-action in menu close file)
Code:
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Edit post - Mozilla Firefox
ahk_class MozillaUIWindowClass


Below i add in config ahk file:
Code:
#IfWinActive ahk_class QWidget ;find the real ahk_class of VLC using Window Spy
^c:: return
#IfWinActive
#IfWinActive ahk_class MediaPlayerClassicW
^c:: return
#IfWinActive


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Maestr0, specter333, tomoe_uehara, Yahoo [Bot] and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group