Sign in to follow this  
Followers 0
Kurtferro

Problem with Hotkey

10 posts in this topic

when I use the hotkey to paste a text (average along) in another window the buttons ctrl+alt remain pressed until i hit it again

With this simple program you can see the problem, copy the my previous text in the editbox and after use ctrl+alt+z to paste on a txt or a window messenger.

#include <GuiConstants.au3>
#NoTrayIcon

Opt("GUIOnEventMode", 1)

CheckPID()

HotKeySet("^!z", "paste")

GuiCreate("MacroPaste by Kurtferro", 310, 200)
WinSetOnTop("MacroPaste by Kurtferro", "", 1)
WinSetTrans("MacroPaste by Kurtferro", "", 245)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

GUISetFont (7, 400, 1, "Cambria Bold")
GuiCtrlCreateLabel("Ctrl+Alt+z for paste the text in another window" , 10, 10)

GUISetFont (9, 400, 1, "Cambria Bold Italic")
$Spaziotesto = GUICtrlCreateEdit("",10, 30, 290, 160, $ES_AUTOVSCROLL+$WS_VSCROLL)


GuiSetState()


; IDLE
While 1
    
    Global $testo = GUICtrlRead($Spaziotesto)
    sleep(300)

WEnd


Func Terminate()
    
Exit 0
    
EndFunc


Func paste()

    Send($testo)
    
EndFunc

Share this post


Link to post
Share on other sites



Yes it seems it does.. send ctrlup and altup after or before you send the copied data

#include <GuiConstants.au3>
#NoTrayIcon

Opt("GUIOnEventMode", 1)

;CheckPID()

HotKeySet("^!z", "paste")

GuiCreate("MacroPaste by Kurtferro", 310, 200)
WinSetOnTop("MacroPaste by Kurtferro", "", 1)
WinSetTrans("MacroPaste by Kurtferro", "", 245)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

GUISetFont (7, 400, 1, "Cambria Bold")
GuiCtrlCreateLabel("Ctrl+Alt+z for paste the text in another window" , 10, 10)

GUISetFont (9, 400, 1, "Cambria Bold Italic")
$Spaziotesto = GUICtrlCreateEdit("",10, 30, 290, 160, $ES_AUTOVSCROLL+$WS_VSCROLL)


GuiSetState()


; IDLE
While 1
    
    Global $testo = GUICtrlRead($Spaziotesto)
    
    sleep(300)

WEnd


Func Terminate()
    
Exit 0
    
EndFunc


Func paste()

    Send($testo)
    Send ("{CTRLUP}{ALTUP}")
    
EndFunc

Share this post


Link to post
Share on other sites

Yes it seems it does.. send ctrlup and altup after or before you send the copied data

#include <GuiConstants.au3>
#NoTrayIcon

Opt("GUIOnEventMode", 1)

;CheckPID()

HotKeySet("^!z", "paste")

GuiCreate("MacroPaste by Kurtferro", 310, 200)
WinSetOnTop("MacroPaste by Kurtferro", "", 1)
WinSetTrans("MacroPaste by Kurtferro", "", 245)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

GUISetFont (7, 400, 1, "Cambria Bold")
GuiCtrlCreateLabel("Ctrl+Alt+z for paste the text in another window" , 10, 10)

GUISetFont (9, 400, 1, "Cambria Bold Italic")
$Spaziotesto = GUICtrlCreateEdit("",10, 30, 290, 160, $ES_AUTOVSCROLL+$WS_VSCROLL)


GuiSetState()


; IDLE
While 1
    
    Global $testo = GUICtrlRead($Spaziotesto)
    
    sleep(300)

WEnd


Func Terminate()
    
Exit 0
    
EndFunc


Func paste()

    Send($testo)
    Send ("{CTRLUP}{ALTUP}")
    
EndFunc

tnx, but it's normal or it's a little bug?

In the help i dont seem there is written It takes so

Share this post


Link to post
Share on other sites

I have tried, the problem still persist.

Share this post


Link to post
Share on other sites

I have tried, the problem still persist.

Your original code I get teh sticky keys so to speak so I do ctrl alt Z and it copies the text then I only need to use the z key cos the other keys are stuck

When I add the line Send ("{CTRLUP}{ALTUP}") from my post I don't get the problem. I'm on XP sp2

Share this post


Link to post
Share on other sites

i'm with vista 32bit, are u sure that work, u have tried with a large text? , i must to post in bug report? i think it's not normal.

Share this post


Link to post
Share on other sites

I have always this problem :)

Share this post


Link to post
Share on other sites

so many of us have had this problem... I really wish it would get fixed... BTW, I just add a few Send ("{CTRLUP}{CTRLUP}{CTRLUP}{ALTUP}{ALTUP}{ALTUP}") just to be safe, and it will work

Share this post


Link to post
Share on other sites

Tnx btw, but this fix dont work with me lol, i must to press ctrl+atl with hands again :)

Share this post


Link to post
Share on other sites

AutoIt can't judge the intent. Maybe you really did mean to have those other keys down, maybe not. We don't know, but you do. So you must be the one to clear the modifier state if that's what you really need to do.

Note: I revived this because there is a bug report referencing this thread. I'm moving the bug report to the NO BUG sub-forum but I'm replying here since this is where all the discussion was.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0