
xbtsw
Members-
Posts
13 -
Joined
-
Last visited
xbtsw's Achievements

Seeker (1/7)
0
Reputation
-
Hi Martin, Thanks for your detailed and useful reply. Yes, the window does have other controls that may need to have focus and receive input. The focus is redirected only in certain condition (depends on the states of other controls). I was trying to simplify the problem in my opening post by ignoring other control. Sorry for the confusion caused by the attempt of that. Your sample using a for loop and ASCII code to bind accelerators is very helpful I never think about this way. This saves me from bind and create function for each keys. Thank you so much.
-
Hi martin and guinness, Thanks for the helpful reply. I know how to test/detect if a control have focus or not. My problem is I don't know how to trigger a precedure (which is set focus to Input1, if Input1 is not on focus) when user enters anything(i.e. pressed a-z or 0-9 or any printable symbol). If user didn't enter anything the focus should stay at where it was. Or say, I have a function "SetFocus", I want to trigger it whenever user pressed any of the a-z and 0-9 and any other printable symbol, while still, the keyboard should be functional as usual (i.e. those keys should still be able to used to enter charactors).
-
Hi Everyone, I am trying to add 'AutoFocus' ability to my application. The application only have one window (Form1) and one Input box (Input1). I want it to be like this: If Form1 is in focus, but Input1 is not in focus and user type anything then the the GUI should automatically activate Input1 and let user type there. The only way that I can think of now is to bind 26 GUIAccelerators from a to z, and write 26 function that activate Input1 and then send key. I wonder if there's a easier way to do it. Thanks!
-
Hi Heron, Thanks for your great work! I hope I find your post earlier, since this is the best pure AutoIt debugger I have seen so far (and still working with latest version of AutoIt and SciTe) It does everything I'd expect for a debugger, stepping, (conditional)breakpoint,variable monitor(table/hovering)/modification and even a probe to execute code on the fly! When I download it, at first it doesn't work for me because it tries to find "AutoIt3.exe" from registry, which not exist on my system. However, I think a better approach that guaranteed to work is to use @AutoItExe marco. So change the code in Dbug.au3, line 789-792 to $AutoItDir = @AutoItExe $run = StringFormat('%s DbugScript.au3 "%s" "%s" "%s" "%s"', $AutoItDir, @ScriptName, @ScriptDir, $DBGnotifyFun, $DBGcommandFun) $res = Run($run, @ScriptDir, default, 0x4) ;run the shadow script (with scriptname and -directory passed as arguments) Then it works beautifully. I think after polish it a little and add some features, it could become the official debugger for AutoIt. Do you got any plan to resume the project? Bests, xbtsw
-
Variable value lost after waiting?
xbtsw replied to xbtsw's topic in AutoIt General Help and Support
Thank you so much for your quick & clear explanation AdmiralAlkex. Happy scripting -
Variable value lost after waiting?
xbtsw replied to xbtsw's topic in AutoIt General Help and Support
Thanks for the reply, that's indeed where the problem is. Can I take the chance to ask one more scope related question: If I declared in global level of a au3 file using "Local", will the scope of the variable is the "File scope" or it's actually global even it's declared as local? Is there a "File scope" idea in autoit? Suppose I have a UDF "testglobal.au3" as following: #include-once Local $amI_Global=1 and include.au3 as following: #include "testglobal.au3" ConsoleWrite($amI_Global & @CRLF) ;will I get 1 here? -
Hello AutoIters I recently working on a script interfacing with a old Java program which does not provide API. The code as follows: ;a piece of code in main program $result = get_token() ;get token return a int here If $result == 0 Then ;code omitted here Else logging("DEBUG: result is: " & $result) ;got token, start waiting wait_for_activation() logging("DEBUG: result after waiting is: " & $result) IniWrite("Data/" & $index[$i_index][1], "profile", "token", $result) EndIf ;wait_for_activation Func wait_for_activation() $activated = 0 Local $temp[2] While $activated == 0 $activated = _ImageSearch("lib/activate.bmp", 1, $temp[0], $temp[1], 40) Sleep(5000) WEnd EndFunc ;==>wait_for_activation The Java program uses a GUI library that can't be handled by Autoit using window infos. (autoit can't see the content inside the window) So I resort to the _ImageSearch library and read screen directly. The activation process takes really long, usually around 5~10 hours. But the weird thing is I can't find the token number in the ini output. and in the log file it's always DEBUG: result is: 3 DEBUG: result after waiting is: It seems the value of $result is lost after waiting. I can't tell the reason. Can anyone kindly tell me where the problem is? Thanks in advance.
-
Maybe you need not set SendKeyDelay, I used to send "^v" in a Dx game, I only set "SendKeyDownDelay" then it got worked.And also, you may try ^a but not ^A, in some programmes ^A actually equals to ctrl+shift+a.
-
help ? Can't switch $WS_EX_TOPMOST ?
xbtsw replied to xbtsw's topic in AutoIt General Help and Support
Thank you! WinSetOnTop() rocks~ -
i hope i can use the checkbox to switch the window between on top and not on top, but the code doesn't work. anyone can help me with my code? Thanks~ #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $Main_Form = GUICreate("test", 573, 340, 244, 129, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS)) $always_on_top = GUICtrlCreateCheckbox("always on top", 446, 93, 97, 17) GUICtrlSetOnEvent($always_on_top, "_setalwaysontop") GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _setalwaysontop() Local $tmp_set_ontop $tmp_set_ontop = GUICtrlRead($always_on_top) Switch $tmp_set_ontop Case $GUI_CHECKED GUISetStyle (-1, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE)) Case $GUI_UNCHECKED GUISetStyle (-1, 0) EndSwitch EndFunc ;==>_setalwaysontop Func _exit() DirRemove(@ScriptDir & "\Data\", 1) Exit EndFunc ;==>_exit
-
any function can only block mouse but not keyboard?
xbtsw replied to xbtsw's topic in AutoIt General Help and Support
Thanks for your advise~ Yes, in one of my script i do it in this way, just finding a better solution~ i am guessing that call some dll can block mouse along, but i don't know which dll to call maybe it will be better for the autoit to separate blockinput to blockkeyboard and blockmouse:) -
any function can only block mouse but not keyboard?
xbtsw replied to xbtsw's topic in AutoIt General Help and Support
Thanks, Controlclick & mousetrap works in winxp but when i apply controlclick in a 3dgame, i found i can't get the control ID -
there is a function named blockinput() in autoit, can block both mouse and keyboard in same time, and meanwhile, the script can control the mouse using mousemove() and mouseclick(). is there any way that can only block mouse but keyboard is not blocked at the same time? because i hope i can use a hotkey to control my script, and block mouse to avoid error. i have tried _mousetrap(), but when the mouse is trapped, the mousemove() and mouseclick() functions doesn't work, as they can't move the mouse too.