AutoHotkey Community

It is currently May 27th, 2012, 6:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: October 7th, 2011, 1:52 am 
Offline

Joined: September 10th, 2011, 2:42 am
Posts: 36
Seems #{Tab} is special combination and is working no matter what.

Anyways, seems I found a solution(although not perfect one).

LWin & r:: Send #r
LWin Up:: MsgBox DoSomething

The only downside of it is that it's not universal. So everytime I would need a new key, I would have to make a new "case" for it, like I don't know...
LWin & d:: Send #d

I guess it's good for now. Maybe someone could point me out how I can make it a universal case, and instead of LWin & r, it will take all the keys that follow after LWin.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2011, 8:50 pm 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
Use the ~ Modifier?
Hotkeys

_________________
Autofire, AutoClick, Toggle, SpamWindow Control Tools
Recommended: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2011, 9:06 pm 
Offline

Joined: September 10th, 2011, 2:42 am
Posts: 36
nimda wrote:
Use the ~ Modifier?
Hotkeys

But that doesn't override the original action as far as I'm concerned.

What I needed was to override the Key action, but let pass all combinations that goes with that key..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2011, 9:27 pm 
Offline

Joined: June 4th, 2010, 9:04 pm
Posts: 1347
Location: california
here's the deal. the word "override" means just that it means you block the key from firing. in that event you have to handle in your script any combinations that may result from using that key. since the windows key is essentially a modifier like shift or alt or control. you will need to provide for any combinations you may want to "re-enable" by adding those conditions in the section that overrides the windows key. One way you might do that is to do a prelim check on the windows key. An example of how that might be done is shown below...
Code:
If (GetKeyState("LWin", "P"))
{     if (GetKeyState("Tab", "P")
      {     Send, #{Tab}
            Return
      }
      If (GetKeyState("R", "P"))
       {     Send, #R
            Return
      }
      If (GetKeyState("Up", "P"))
       {     Send, #{Up}
            Return
      }
}
Return

You would have to figure out which combinations you'd want to handle and include them in your script. the ones that aren't specified would be effectively disabled except for those which are overridden by the Operating System itself. Disabling modifiers can get a bit messy as you can see.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2011, 10:04 pm 
Offline

Joined: September 10th, 2011, 2:42 am
Posts: 36
girlgamer, thanks for another reply of yours!

girlgamer wrote:
here's the deal. the word "override" means just that it means you block the key from firing.

Well... ;), don't want to be annoying here, but override means override, not "block" ;) Override usually in programming languages(java, c# etc) means, you don't want it to do something it was doing originaly and you want to alter that action and do something else(although it might not, you might override it and do the same thing it did before).

Quote:
in that event you have to handle in your script any combinations that may result from using that key. since the windows key is essentially a modifier like shift or alt or control. you will need to provide for any combinations you may want to "re-enable" by adding those conditions in the section that overrides the windows key. One way you might do that is to do a prelim check on the windows key. An example of how that might be done is shown below...
Code:
If (GetKeyState("LWin", "P"))
{     if (GetKeyState("Tab", "P")
      {     Send, #{Tab}
            Return
      }
      If (GetKeyState("R", "P"))
       {     Send, #R
            Return
      }
      If (GetKeyState("Up", "P"))
       {     Send, #{Up}
            Return
      }
}
Return

You would have to figure out which combinations you'd want to handle and include them in your script. the ones that aren't specified would be effectively disabled except for those which are overridden by the Operating System itself. Disabling modifiers can get a bit messy as you can see.

Thanks for that!

Seems there was a reason why I couldn't figure out how to do it in a more elegant, clever way ;)

In my script, http://www.autohotkey.com/forum/viewtopic.php?t=77448, I handled it just like you described:

Code:
RWin Up::
if(taskBarActive = 1)
{
   Send {RWin}
   if(triggeredByWindowsKey = 1)
      triggeredByWindowsKey := 0   ;And set triggeredByWindowsKey flag to 0 to finish the "triggered by WinKey" time
   else
      triggeredByWindowsKey := 1
}
else
{
   triggeredByWindowsKey := 1
   WinShow ahk_class Shell_TrayWnd
   WinActivate, ahk_class Shell_TrayWnd
   WinWaitActive, ahk_class Shell_TrayWnd

   taskBarActive := 1
   WinShow Start ahk_class Button
   Send {RWin}
}
return

RWin & r:: Send #r


Good thing is, I don't use any win key combinations, except for ocasional #r, so my job was very quick here ;)

cheers


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2011, 8:47 am 
Offline

Joined: September 10th, 2011, 2:42 am
Posts: 36
Hey guys, got another question. I searched for it, but it seems it was not asnwered on the forum, at least from the tittle search I did.

Is it possible to get the width of the folder sidebar?

cheers


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2011, 3:10 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
You mean the width of the taskbar (sidebar)?
That & a whole bunch of other settings, are stored as a SINGLE BINARY value (:() in a registry key. Maybe some Windows expert (on some windows forum) might know how to extract that value? (been wanting that info myself!)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2011, 3:18 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
When you say 'sidebar' do you mean the treeview or common taks sidebar of and explorer window
ImageImage
Code:
setTimer, watchWin, 10
return

watchWin:
  controlGetPos,,, sbW,, directUIHWND1, A
  controlGetPos,,, tvW,, sysTreeView321, A
  trayTip,, % ( tvW ? "Treeview width is " tvW "px" : "Please select an explorer window!" )
            . ( sbW ? "`nCommon tasks width is " sbW "px" : "" )
return
esc::exitApp ; <-- press escape to exit.
:?:

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2011, 3:39 pm 
Offline

Joined: September 10th, 2011, 2:42 am
Posts: 36
Thanks guys for replies!

a_h_k wrote:
You mean the width of the taskbar (sidebar)?


TLM wrote:
When you say 'sidebar' do you mean the treeview or common taks sidebar of and explorer window

Image

Quote:
That & a whole bunch of other settings, are stored as a SINGLE BINARY value (:() in a registry key. Maybe some Windows expert (on some windows forum) might know how to extract that value? (been wanting that info myself!)

hehe ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 10th, 2011, 3:48 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
TLM wrote:
When you say 'sidebar' do you mean the treeview (ie the "explorer bar") or common tasks sidebar of and explorer window?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], migz99, sjc1000 and 71 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