Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 12:17

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ControlSend is sending keys everywhere

Discussion on ControlSend is sending keys everywhere within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
WalrossGreat's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 871
Received Thanks: 1,229
ControlSend is sending keys everywhere

Hi, I have problem with au3.
For example i have code like it:

ControlSend($game, "", "", "S")
Script is sending S, but when i open firefox, he is sending it to $game and to Firefox. After 5 minutes keyboard are getting bug. Keyboard is having press space/shift all the time etc. What is wrong? Is it au3 bug?

mfG Warloss.
WalrossGreat is offline  
Old 03/22/2015, 19:40   #2

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
You are not the only one. When I experimented with ControlClick, it was really weird as well. If you have any alternative, I would recommend you not to use ControlSend
Moneypulation is offline  
Old 03/22/2015, 20:00   #3
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Try SendMessage, this should only click / send the window.
alpines is offline  
Old 03/22/2015, 20:46   #4
 
WalrossGreat's Avatar
 
elite*gold: 0
Join Date: Mar 2015
Posts: 871
Received Thanks: 1,229
Ok, I'm having

Code:
Local $hWnd = WinGetHandle("Notepad")
MsgBox("", "", $hWnd)
    If @error Then
        MsgBox("", "", "An error occurred when trying to retrieve the window handle of Notepad.")
        Exit
    EndIf
While 1
	_SendMessage($hWnd, 32)
	Sleep(300)
WEnd
But it is doing nothing after run script.
I found only it:
Code:
https://www.autoitscript.com/autoit3/docs/libfunctions/_SendMessage.htm
and the second parametr - $iMsg should be a number. It mean number of key, or what?
WalrossGreat is offline  
Old 03/23/2015, 00:03   #5
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
No, it's the number of the message. w and l Param define the keys and position. There are plenty examples on the internet.
alpines is offline  
Old 03/24/2015, 17:51   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,234
Received Thanks: 1,095
you should use Control Get Handle
Code:
;#Example
$Hwnd = WinGetHandle("[ACTIVE]","") ;click on active window
$Cwnd = ControlGetHandle($Hwnd, "", "")

controlsend($Cwnd, "", "", "")
just example. not correct code ofcourse.
fear-x is offline  
Reply


Similar Threads Similar Threads
Sending keys to kalonline client IN A VM
01/16/2014 - Kal Online - 3 Replies
so i've made my own bot for kalonline and it works perfectly fine on my own pc. the problem is that kalonline has to be an active window: if i use controlsend functions my computer crashes after a while. So i tried to run the kal client + my bot on a vm client (vmware) But the autoclicks and colorsearches dont work on the client lol Colorsearches always return hexvalues 00000 etc. the bot works when the kal client is not active on the vm though anyway to fix it? kind regard
Sending virtual keys
07/17/2012 - AutoIt - 9 Replies
i know that controlSend does this but in my case ControlSend doesnt work because it gets blocked. so i want to ask if anybody knows any other solution to this on how to send a virtual key to a game and while sending it allowing me to do other stuf like text to my friends ingame/msgrs.
Sending Keys To Grand Chase
05/22/2011 - Grand Chase - 2 Replies
I'm playing around with creating scripts, bots, etc with simple commands for GC. All i've been trying to do is send simple clicks, keys and other stuff to Grand Chase window, but although the script is working, Grand Chase does not seem to respond or accept the keys. For example, the bot will make Grand Chase the active window, enter several clicks and keys, and nothing happens. Anyone explain this to me please? Thanks.
swsro2 question regarding srokey sending keys
06/07/2010 - SRO Private Server - 10 Replies
ok i bought 2 keys from srokey, and i haven't recieved any keys in the mail i dont know what to do i want to play..



All times are GMT +1. The time now is 12:19.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.