AutoHotkey Community

It is currently May 26th, 2012, 3:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: February 18th, 2009, 3:50 am 
First of all, I realy love this great program!!
Now my problem: ...

I'v made a very simple script to catch WINDOWS-D (#d) and make it dump the current date.

heres my code
Code:
; WIN-d  output current date as text
;--------------------------------------------------------------

#d::
   FormatTime, TimeString,, yyyy'-'MM'-'dd
   Send, %Timestring%
return


now when doing regular windows things like email etc ... windows will now and then get confused and when i press the key "d" (WITHOUT the windows key) it prints out the date or minimizes all my applications (the normal windows behaviour for WINDOWS-D key)

My question:
- How to make the default WINDOWS-D key dead.
- if there is an error in my script, please let me know.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2009, 4:43 pm 
Offline

Joined: February 8th, 2009, 5:52 pm
Posts: 47
Your script looks fine to me... but i'm no expert... would be curious to see what the explanation is


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2009, 9:57 pm 
Offline

Joined: February 17th, 2008, 8:52 pm
Posts: 314
Code:
#d::
   FormatTime, TimeString,, yyyy'-'MM'-'dd
   Send, %Timestring%
   Send, {# up}{d up} ;<-------Try this
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2009, 10:20 pm 
Offline

Joined: December 8th, 2006, 5:17 am
Posts: 248
Location: Sydney Australia
This might work too. It should only fire the hotkey when the WIN key is in down state. Untested though
Code:
#d::
GetKeyState RWINstate, RWin
If RWINstate != D
   Return   ; do nothing
GetKeyState LWINstate, LWin
If LWINstate != D
   Return   ; do nothing
FormatTime, TimeString,, yyyy'-'MM'-'dd
Send, %Timestring%
return

_________________
Paul O


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 19th, 2009, 12:47 am 
oo thanx for the feedback guys!! :D


both seem very plausible sollutions to me.

i'll try the sollution from vahju first.
Ill let you know if the problem comes back.

as extra infomation i would like to say that i use a lot of hotkeys controlled by autohotkey. Yeah i know, i'm one of those guys that prefer the keyboard above the mouse 8)

anyway, all those other hotkeys do not make any trouble at all though they are way more advanced than the simple windows-d script.

I'll be back ;-)
thanx a lot guys!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 8:15 pm 
hmmm, i was so happy it did work until today :(

now i have the same problem with the key "u"

same story as with windows-d key
sometimes but not allways, when i simply press the key "u" windows starts the program "narator" it is a program i even never use lol

so i think the problem is deeper to be found in windows or autohotkey or both.

i use windows xp english sp3


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 8:26 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
BTW you know that DATE and TIME commands can be run directly from comspec right?

Just go to start - run - type cmd

Enter Date or Time and you will see what I mean. Now those can both be run from comspec ;)

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2009, 8:38 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
braintje wrote:
i use a lot of hotkeys controlled by autohotkey... they are way more advanced than the simple windows-d script.


The obvious solution would be that one of these is leaving the windows key down. I'd investigate that possibility first.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2009, 4:06 am 
TheLaughingMan wrote:
BTW you know that DATE and TIME commands can be run directly from comspec right?

Just go to start - run - type cmd

Enter Date or Time and you will see what I mean. Now those can both be run from comspec ;)


sure, i knew that hehe

i use the date "hotkey" to fill in the date where i need it in windows programs, is very handy so i dont have to type the date over and over again.

i do not understand jaco0646, are you joking?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2009, 6:31 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5478
Location: the tunnel(?=light)
Why not try adding an additional modifier and see if you get the same behavior? Instead of #d, switch it to ^#d, which isn't particularly obtrusive to your normal keystrokes.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2009, 3:41 am 
i found in the manual (yes i know we all should rtfm) :-) ....
to use Sendplay as prefered to Send

now (so far) it works as it should for about +- 10 days now
the trouble did not come back once at all.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: DataLife, notsoobvious and 12 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