AutoHotkey Community

It is currently May 26th, 2012, 6:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: AppsKey behaving weird
PostPosted: February 25th, 2008, 6:55 am 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
When i use the following code to open rightclick menu and select edit, it wont make the opened file window active like it does if i manually press E

Code:
#IfWinActive ahk_class ExploreWClass
^LButton::
#IfWinActive
Send {Click}{AppsKey}{E}
return


Does any 1 know what im missing here?
(tried delay already)

- TY

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2008, 5:22 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
What is the {click} in there for?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2008, 9:33 pm 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
If i dont {Click}, it doesnt not open the specific file's Appskey menu that is under the mouse pointer, it opens the active things“s menu.

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2008, 10:22 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
It works for me if I add:
Code:
#IfWinActive ahk_class CabinetWClass
^LButton::
The window class depends on how Explorer was launched.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2008, 11:40 pm 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
Im using this code:
Code:
if WinActive("ahk_class ExploreWClass") or WinActive("ahk_class CabinetWClass")
^LButton::
Send {Click}{AppsKey}{E}
return


It opens the desired file in TextPad as wanted, but it wont bring it to front after opening like it does if its Notepad.

Thats, not the Click. Sorry if i didnt make myself clear..

- TY

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 12:12 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3328
Location: Simi Valley, CA
I'm not sure what your asking for...
Code:
#IfWinActive ahk_class CabinetWClass
^$LButton::Goto, CtrlClik
#IfWinActive ahk_class ExploreWClass
^$LButton::Goto, CtrlClik
#IfWinActive

CtrlClik:
Send {Click}{AppsKey}
Loop 19
{
   SendPlay {down}
   StatusBarGetText, opv , 1, A
   If InStr(opv, "edit") != 1
      continue
   send {enter}
   break
}
If InStr(opv, "edit") != 1
   Send {esc}
return

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 3:47 am 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
I suppose that code will send Click, Appskey then keep pressing Down key until it finds `edit` to press enter 19 times. So i tried this variation to ty the {enter} command instead:

Code:
if WinActive("ahk_class ExploreWClass") or WinActive("ahk_class CabinetWClass")
^LButton::
SendPlay {Click}{AppsKey}{Down 3}{Enter}
return


and the window still opens in the bottom, it wont come to front as my active window, the way i want it to be.

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 3:56 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
I think see the problem. It's because is involves holding Ctrl, which will do that.

Try one of there varients:
Code:
^LButton::
#IfWinActive
KeyWait Ctrl ;wait for Ctrl to be released
Send {Click}{AppsKey}{E}
return

Code:
^LButton::
#IfWinActive
Send {Ctrl Up}{Click}{AppsKey}{E} ;release Ctrl automatically
return

Code:
!LButton:: ;Use Alt instead.
#IfWinActive
Send {Click}{AppsKey}{E}
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 4:48 am 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
Tried
releasing Ctrl
replacing for Alt

none worked :(


ps - I dont want it to wait for key release..

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 5:30 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
bvaroni wrote:
Tried
releasing Ctrl
replacing for Alt

none worked :(

I tested them a little more and you're right. Well, they sometimes work, but they have poor reliability.

bvaroni wrote:
ps - I dont want it to wait for key release..

:?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 5:52 am 
Offline

Joined: February 22nd, 2008, 6:12 pm
Posts: 44
why are they unreliable? what happens ? lol

_________________
- Humor is but another weapon against the universe - Mel Brooks


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 6th, 2008, 9:44 pm 
I have the same problem as bvaroni. Namely, after sending {AppsKey}, the next key in not accepted and I have to press in manually. Here is my code:
Code:
#l::Send,^a{AppsKey}{h}


The "Select All" works and the right-click menu appears but the "h" key is not accepted. I tried Sleep and other kinds of delay but none worked. Any ideas?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Exabot [Bot], JSLover, Tipsy3000, Yahoo [Bot] and 68 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