AutoHotkey Community

It is currently May 27th, 2012, 4:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: July 8th, 2011, 7:49 pm 
Offline

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
Thank you maul.esel, Frankie and Mickers
it works almost perfectly now
all three functions run properly

1 more thing though, lbutton doesnt count as an endkey for input.
i set it to send the vk sc key whenever lbutton is pressed so it *should* work

any ideas?

also, is #persistent required here?

code:
Code:
#SingleInstance force
#persistent
DetectHiddenText, On

Gui +LastFound
hWnd := WinExist() ; storing the window handle of the gui
DllCall("SetParent", "uint", hWnd, "uint", -3) ; -3 is HWND_MESSAGE
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK")
OnMessage( MsgNum, "ShellMessage" ) ; calls ShellMessage() function when a message appears

loop
{
Input, uinput, V L100 C, {enter}{vkF9sc8B3}{tab}
if uinput
{
soundbeep, 2000,100
}
}
return

ShellMessage( wParam,lParam, msg, hwnd ) ; see Onmessage() page for moreinfo
    {
soundbeep, 1000,100
soundbeep, 1000,100
   }
return


OnClipboardChange:
   soundbeep, 500,100
   soundbeep, 500,100
   soundbeep, 500,100
return

~LBUTTON::
sendinput,{vkF9sc8B3}
return

~esc::reload
~^Shift::exitapp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2011, 8:09 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Input installs the keyboard hook. That means you can't trick it with Send or remapping.

For the third time, I would recommend using hotkeys.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2011, 8:16 pm 
Offline

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
i need the whole input though, i cant make 10000000000 hotkeys for every word in the english dictionary now can i?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2011, 8:25 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Type something and press enter. I can't make it any simpler :roll:

Code:
Loop, 26
    Hotkey, % "~" . Chr(96+A_Index), Count
Loop, 10
    Hotkey, % "~" A_Index-1, Count
Pressed := ""

return

Count:
User_Input .= SubStr(A_ThisHotkey, 2)
return

~Enter::
~Tab::
~vkF9sc8B3::
If (User_Input = "")
    return

MsgBox, You said "%User_Input%"
; Actions here

User_Input := "" ; Clear the input
return


Btw, this was the 2nd reply on this topic; only modified with other information in this topic.

Edit: The orange part goes at the top of your code, everything else goes at the bottom.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2011, 8:37 pm 
Offline

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
works like a charm.
Thanks!

how do i add hotkeys for
~`!@#$%^&*()_+-=|\?<>.,/{}[]"':;
?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2011, 8:43 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Code:
Loop, 64
    Hotkey, % "~" . Chr(31+A_Index), Count
Replace both loops with this. It doesn't include } | {. Everything else should work.

Not tested. If my math is wrong:
http://www.asciitable.com/

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 8th, 2011, 8:56 pm 
Offline
User avatar

Joined: February 28th, 2011, 7:28 pm
Posts: 625
Location: Germany
#Persistent is not required, as you use a GUI command [and hotkeys].

_________________
RECOMMENDED: AutoHotkey_L
Image
github - ImportTypeLib
Win7 HP SP1 32bit | AHK_L U 32bit


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

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
Code:
Loop, 95
    Hotkey, % "~" . Chr(31+A_Index), Count
   ;% (so my editor doesnt think all the file is a variable)
Pressed := 0
return

Count:
User_Input .= SubStr(A_ThisHotkey, 2)
return

~Enter::
~Tab::
~lbutton::
If (User_Input = "")
    return
MsgBox,,,%User_Input%,.5
User_Input := "" ; Clear the input
return

esc::exitapp


always returns uppercase letters

also, it doesnt delete the last inputted char if backspace is pressed, like in input

isnt there a quick hack to let lbutton end input?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], rbrtryn, 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