Jump to content
Sign in to follow this  
imNew

How to reliably unstuck ctrl alt and shift ( not just by send() )

Recommended Posts

imNew

due to the nature of what I am doing, my keys will get stuck, unavoidable, I just need a reliable _clearKeys()

My observation so far:

send(key up) works ALL the time for normal keys, ie. asdf's

same can't be said for ctrl alt and shift

in a simple ctrl click:

send("{ctrldown}")

for $ i = 0 to 4

mouseclick("left", 11, 11)

next

send("{ctrlup}")

in my particular instance, send("{lctrl down}"), send("{lctrldown}"), send("{ctrl up}"), send("{lctrl up}"), send("{lctrlup}") do not work or they will not free the ctrl key at the end.

only send("{ctrlup}") works, but not always either.

in severe cases, even a send ("ctrl") will get the ctrl key stuck (SendKeyDownDelay=30 or higher)

What I am afraid is that, once the ctrl key is stuck in down position, all the subsequent send(key) will be interpreted as send(ctrl+key), EVEN the send( ctrl up) attempts.

I would like a function that is lower level, something like _isPressed("12"), that can just clear all the "down" keys.

my system is x64 windows 7.

Edited by imNew

Share this post


Link to post
Share on other sites
nitekram

Just asking a question - is it possible to fix this? I know there is a work around in place - a few in fact. But just wondering if we can change the function/code to change the status of keys to what they were before this command Send() was used with the shift, ctrl, alt keys.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites
imNew

thanks a lot for the pointer. I will look at it more serious now.

I m assuming ControlSend("","","","",0) won't work right? some key, any, has to be controlsent in order for that to work.

Share this post


Link to post
Share on other sites
PhoenixXL

why not use _Winapi_Keybd_event, twice

once for pressing the key and the other for releasing it,

I havent noticed any problems with it yet :)


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
JohnOne

thanks a lot for the pointer. I will look at it more serious now.

I m assuming ControlSend("","","","",0) won't work right? some key, any, has to be controlsent in order for that to work.

Why would you assume that even with it being in the FAQ as an answer?

Perhaps they just put it there for a laugh.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
imNew

well, mostly because in ideal conditions, ie. testing in textpad, send (key up) operations will always free my keys, don't even need the controlSend.

However I encounter loads of problems when the stuff I am trying to interface with doesn't register key presses in an orthodox way and there are delays as well. That's why after trying FAQs once without any breakthru, I gave up and came on the forum. Apparently the FAQ is the best solution, then I have to try to make it work.

Share this post


Link to post
Share on other sites
Melba23

imNew,

I note your original post read:

"in my particular instance (a game environment), send("{lctrl down}"), send("{lctrldown}"), send("{ctrl up}"), send("{lctrl up}"), send("{lctrlup}") do not work"

I also note that you have amended this without being prompted - but please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing gane automation - before you post again. :naughty:

The fact that you are trying to use AutoIt in a game is undoubtedly why you are having these problems - therefore there seems little point in continuing with this thread. And so...... ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×