AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: input lbutton endkey?
PostPosted: July 9th, 2011, 12:33 am 
Offline

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
i need to get the input from the user and use lbutton as an endkey.

something like

Code:
loop
{
Input, uinput, V L100 C, {lbutton}
if uinput
{
msgbox, %uinput%
}
}
return

but it doesnt end on lbutton

or

Code:
Loop, 95
    Hotkey, % "~" . Chr(31+A_Index), Count
   ;% (so my editor doesnt think the rest of the script is a variable
Pressed := 0
return

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

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

but it doesnt differentiate between lower and uppercase letters and it doesnt correct for backspaces


either one works for me, i just need to get the input whenever lbutton is pressed[/code]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2011, 4:58 am 
Offline

Joined: February 6th, 2010, 5:17 pm
Posts: 57
Set LButton as a hotkey that sends an ending key that's on the keyboard.
Code:
loop
{
   Input, uinput, V L100, ^!+{F24}
   if uinput
      msgbox, %uinput%
}
return

~LButton::Send, ^!+{F24}
Esc::ExitApp


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

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
Use Matchlist instead of endkey

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


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

Joined: August 2nd, 2009, 6:40 am
Posts: 215
This works,
Code:
GetUserInput()
Return

GetUserInput()
{
    HotKey, LButton, LButtonEndKey
    Input, uInput, V L100 C, {F24}
    HotKey, LButton, LButtonEndKey, OFF
    if( uInput )
        MsgBox, %uinput%
Return
}

LButtonEndKey:
   Send, {F24}
   HotKey, LButton, LButtonEndKey, OFF
Return

ih57452's solution would work as well, but I imagine the code snippet will be contained within a larger script --- and you wouldn't necessarily want to exit immediately after obtaining user input.


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

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
ih57452, your code is *almost* exactly what i want.

When i click on explorer on the task bar in windows 7 to switch explorer folders, it the popup dialog closes before the click is registered.

Is there a way to make sure the lbutton is sent first, and then the F24 combination afterwards?
i need to retain click and drag functionality though

crash&burn
i dont understand your code.


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

Joined: August 2nd, 2009, 6:40 am
Posts: 215
What's to understand? It temporarily overrides Left Click, waits for input. Stops input when LeftClick is done. And removes the Left-Click override.

You cannot "retain click-and-drag" while at the same time using LButton as an EndKey. The hotkey override for LButton needs to be removed. Which if you even bothered to run my code, you'd not post that you don't understand it.


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

Joined: February 6th, 2010, 5:17 pm
Posts: 57
Code:
*$LButton::
Send, {LButton}
;add a sleep if it still doesn't work
Send, ^!+{F24}
return


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

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
no drag though.
I solved it with a sleep, 1000 on your first script.

Thanks everyone who helped


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

Joined: February 6th, 2010, 5:17 pm
Posts: 57
I guess I should have tried it before I posted it. :D
Code:
*$LButton::Send, {LButton Down}

*$LButton Up::
Send, {LButton Up}
Send, ^!+{F24}
return


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

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
ah, almost

im still missing the ability to shift select if you understand what i mean.

like in a document, clicking somewhere, holding shift and clicking somewhere else and have the text in between selected.

idk if that can be fixed though...


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

Joined: February 6th, 2010, 5:17 pm
Posts: 57
I forgot about Blind Mode:
Code:
*$LButton::Send, {Blind}{LButton Down}

*$LButton Up::
Send, {LButton Up}
Send, ^!+{F24}
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 17th, 2011, 6:50 pm 
Offline

Joined: August 2nd, 2009, 6:40 am
Posts: 215
You'd be better off with this, then:
Code:
~LButton::return
~*LButton Up::Send, ^!+{F24}

Then you don't have to handle the LButton state, and risk it getting stuck down.


Report this post
Top
 Profile  
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: 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