AutoHotkey Community

It is currently May 27th, 2012, 8:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: December 21st, 2006, 9:56 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Titan wrote:
0x0061 = a, in fact they all look like they're supposed to be hex digits.


Yes .. it is :oops:

Thanks, :D

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2006, 10:09 pm 
Titan wrote:
Goyyah wrote:
code uses the ternary operator instead
Hmm you can make it even shorter with a wrapper function.
Code:
a::SendIU(430)
b::SendIU(431)
v::SendIU(432)
g::SendIU(430)
d::SendIU(434)
e::SendIU(435)
z::SendIU(437)
i::SendIU(438)

SendIU(c) {
   If GetKeyState("CapsLock", "T")
      SendInputU(c)
   Else Send %A_ThisHotkey%
}


This doesn't seem to work for me. I get:

71 hotkeys have been received in the last 1094ms.

Do you want to continue?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2006, 10:12 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Try putting $ before each hotkey ($a, $b, etc).

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2006, 10:18 pm 
Titan wrote:
Try putting $ before each hotkey ($a, $b, etc).


Hmmm, what happens now when I type a I get:

$a

or when I type d:

$d

etc. and nothing happens when I have caps on...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2006, 10:22 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Oh that's right, you have to remove the $ when you send... so use Send % SubStr(A_ThisHotkey, 2)
I tested this and it works.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 22nd, 2006, 1:58 am 
Offline

Joined: November 16th, 2006, 3:40 pm
Posts: 10
Skan wrote:
Dear Geoff, :)

Further to your Private Message I post the following solution:

Code:
DetectHiddenWindows, ON

~CapsLock::
 If GetKeyState("CapsLock","T")
    Gui, 1:Show, w100 h100 Hide, Ahk.Dummy.Window
 Else
    Gui, 1:Destroy
Return

#IfWinExist, Ahk.Dummy.Window

a::SendInputU( "0430" )
b::SendInputU( "0431" )
v::SendInputU( "0432" )
g::SendInputU( "0430" )
d::SendInputU( "0434" )
e::SendInputU( "0435" )
z::SendInputU( "0437" )
i::SendInputU( "0438" )

#IfWinExist


Not-so-elegant .. as the GUI will be consuming memory ( 1 MB+ ) when CapsLock is ON.

The following code uses the ternary operator instead:

Code:
a::CapsON() ? SendInputU( "0430" ) : SendInputU( "0061" )
b::CapsON() ? SendInputU( "0431" ) : SendInputU( "0062" )
v::CapsON() ? SendInputU( "0432" ) : SendInputU( "0076" )
g::CapsON() ? SendInputU( "0430" ) : SendInputU( "0061" )
d::CapsON() ? SendInputU( "0434" ) : SendInputU( "0064" )
e::CapsON() ? SendInputU( "0435" ) : SendInputU( "0065" )
z::CapsON() ? SendInputU( "0437" ) : SendInputU( "007A" )
i::CapsON() ? SendInputU( "0438" ) : SendInputU( "0069" )

CapsON() {
Return GetKeyState("CapsLock", "T")
}



Hope the information is useful.

Regards, :)


I like the not so elegant solution the best :)

One problem with it:

This worked just fine in the old version

Code:
d::
   If CapsON()
   {
      SendInputU( "0434" )
   }
   Else SendInputU( "0064" )
return

:?c*:DD::
   If CapsON()
   {
      SendInputU( "0402" )
   }
   Else
   {
      SetKeyDelay, -10
      SendInputU( "00640064" )
   }
return


Basically, if one D is pressed you get one thing, but if two are pressed it replaces those two with one character. Worked just fine.

BUT, using the hidden GUI method, this fails to work. Any ideas?

Here's the code:

Code:
DetectHiddenWindows, ON

~CapsLock::
 If GetKeyState("CapsLock","T")
    Gui, 1:Show, w100 h100 Hide, Ahk.Dummy.Window
 Else
    Gui, 1:Destroy
Return


#IfWinExist, Ahk.Dummy.Window

d::SendInputU( "0434" )

:?c*:DD::SendInputU( "0452" )
[code continues...]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 3rd, 2007, 9:51 am 
For some strange reason, this SendInputU( "0151" ) with unicode chars doesn't work in Skype. It inserts simple o instead of ő. Why?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bobbysoon, BrandonHotkey, just me and 76 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