xNeoX Posted December 5, 2008 Share Posted December 5, 2008 A flaw in a protocol program of mine is extremely annoying, now I ahbe here following the code of operation should be posted if it tests you'll remember her as soon as their shift with the right taste great writes a letter from that date will be capitalized until everything it expresses left shift. But as soon the F1 button and the display text can be displayed properly what this is the reason? #include <File.au3> MsgBox(0,"Info","Hello write something in teh Editor then press F1 you will see in a Msg Box what you´v worte") run ("notepad.exe") $str="" $bs=StringSplit(", ,+,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W ,X,Y,Z,0,1,2,3,4,5,6,7,8,9,!,?,&,ä,ü,_,.",",") $i=1; Func e() HotKeySet(@HotKeyPressed) Send(@HotKeyPressed) $str=$str&@HotKeyPressed HotKeySet(@HotKeyPressed,"e") EndFunc While $i<=$bs[0] HotKeySet($bs[$i],"e") $i=$i+1; WEnd HotKeySet ("{F1}","Test") Func Test() MsgBox (0,"Outpoot",$str) endfunc while 1 sleep (999) wend Link to comment Share on other sites More sharing options...
ChangMinYang Posted December 5, 2008 Share Posted December 5, 2008 A flaw in a protocol program of mine is extremely annoying, now I ahbe here following the code of operation should be posted if it tests you'll remember her as soon as their shift with the right taste great writes a letter from that date will be capitalized until everything it expresses left shift. But as soon the F1 button and the display text can be displayed properly what this is the reason? #include <File.au3> MsgBox(0,"Info","Hello write something in teh Editor then press F1 you will see in a Msg Box what you´v worte") run ("notepad.exe") $str="" $bs=StringSplit(", ,+,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W ,X,Y,Z,0,1,2,3,4,5,6,7,8,9,!,?,&,ä,ü,_,.",",") $i=1; Func e() HotKeySet(@HotKeyPressed) Send(@HotKeyPressed) $str=$str&@HotKeyPressed HotKeySet(@HotKeyPressed,"e") EndFunc While $i<=$bs[0] HotKeySet($bs[$i],"e") $i=$i+1; WEnd HotKeySet ("{F1}","Test") Func Test() MsgBox (0,"Outpoot",$str) endfunc while 1 sleep (999) wend It is not bug, it just your syntax miss. Read first to 'send' section in help file. You could read to process keystroke '+'. Link to comment Share on other sites More sharing options...
xNeoX Posted December 5, 2008 Author Share Posted December 5, 2008 This tells AutoIt to send a SHIFT keystroke, therefore Send("Hell+o") would send the text "HellO". Send("!+a") would send "ALT+SHIFT+a". this?^^ im german so my english is not the best how can i fix this mistake? Link to comment Share on other sites More sharing options...
KaFu Posted December 5, 2008 Share Posted December 5, 2008 (edited) Send(@HotKeyPressed,1) ? Edited December 5, 2008 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
xNeoX Posted December 5, 2008 Author Share Posted December 5, 2008 no thats just a part from the help files my problem is in the first poste Link to comment Share on other sites More sharing options...
KaFu Posted December 5, 2008 Share Posted December 5, 2008 Ähmmm, schreib mal kurz auf Deutsch, wo das Problem liegt... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
xNeoX Posted December 5, 2008 Author Share Posted December 5, 2008 ^^ sobald man mit der rechten shift taste einen buchstaben groß schreibt wird ab diesem Zeitpunkt alles groß geschrieben bis man die linke shift taste drückt (in der msg box wird alles richtig dargestellt) du kannst es mal testen sollte zu starten sein Link to comment Share on other sites More sharing options...
weaponx Posted December 5, 2008 Share Posted December 5, 2008 I don't see the problem with StringSplit...the leading comma in your string will result in a blank element in your array (not a space). $bs=StringSplit(', ,+,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,!,?,&,ä,ü,_,.',',') For $X = 1 to $bs[0] ConsoleWrite($bs[$X] & @CRLF) Next Link to comment Share on other sites More sharing options...
KaFu Posted December 5, 2008 Share Posted December 5, 2008 ^^ sobald man mit der rechten shift taste einen buchstaben groß schreibt wird ab diesem Zeitpunkt alles groß geschrieben bis man die linke shift taste drückt (in der msg box wird alles richtig dargestellt) du kannst es mal testen sollte zu starten seinProblem is, from the moment you press the right shift key all letters are capitalized until you press the left shift key (even then some are still capital)... Will look into it... nun sehe ich das Problem , schaus mir mal an...Gruß OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
xNeoX Posted December 5, 2008 Author Share Posted December 5, 2008 but why is caps lock active when i press RShift? in the box whitch is showen if i press F1 everything is right formated Link to comment Share on other sites More sharing options...
xNeoX Posted December 6, 2008 Author Share Posted December 6, 2008 Push.... nobody any idea? q.q Link to comment Share on other sites More sharing options...
ResNullius Posted December 6, 2008 Share Posted December 6, 2008 but why is caps lock active when i press RShift? in the box whitch is showen if i press F1 everything is right formatedIt's a common problem with Send() command being executed when certain other keys, CTRL. ALT, (right) SHIFT key is held down. Using a Send() replacement that martin devised, this should work: expandcollapse popup#include <File.au3> #include <misc.au3> MsgBox(0,"Info","Hello write something in teh Editor then press F1 you will see in a Msg Box what you´v worte") $pid = run ("notepad.exe") $str="" $bs=StringSplit(", ,+,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W ,X,Y,Z,0,1,2,3,4,5,6,7,8,9,!,?,&,ä,ü,_,.",",") $i=1; Func e() HotKeySet(@HotKeyPressed) ConsoleWrite(@HotKeyPressed & @crlf) _SendEx(@HotKeyPressed) $str=$str&@HotKeyPressed HotKeySet(@HotKeyPressed,"e") EndFunc While $i<=$bs[0] HotKeySet($bs[$i],"e") $i=$i+1; WEnd HotKeySet ("{F1}","Test") Func Test() MsgBox (0,"Outpoot",$str) endfunc While ProcessExists($pid) sleep (999) WEnd Func _SendEx($ss,$warn = "") ;http://www.autoitscript.com/forum/index.php?s=&showtopic=37289&view=findpost&p=512706 ;by martin Local $iT = TimerInit() While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12") if $warn <> "" and TimerDiff($iT) > 1000 Then MsgBox(262144, "Warning", $warn) EndIf sleep(50) WEnd Send($ss) EndFunc;==>_SendEx Link to comment Share on other sites More sharing options...
xNeoX Posted December 7, 2008 Author Share Posted December 7, 2008 (edited) hi thank you verry mutch no it works but can you explain the function _SendEx a bit ? Ididnt understand what _isPressed ("10) or..... is for. another thing i noticed if you press lshift or rshift in combo with a key there is no outpoot until you stop pressing shift key Edited December 7, 2008 by xNeoX Link to comment Share on other sites More sharing options...
KaFu Posted December 7, 2008 Share Posted December 7, 2008 Hi xNeoX, in fact i did look into this a bit more... without coming up with a solution. The _ispressed() UDF is a user32.dll call (low level check) and checks if SHIFT, ALT or CTRL (10,11,12) are pressed and waits until they are not pressed before performing the send()... Regards OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
xNeoX Posted December 10, 2008 Author Share Posted December 10, 2008 ok thx is it possible to cancel this that any key i pressed in combo with shift is outpoot instantly? and do´nt wait for an "dont press shift"? Link to comment Share on other sites More sharing options...
martin Posted December 10, 2008 Share Posted December 10, 2008 ok thx is it possible to cancel this that any key i pressed in combo with shift is outpoot instantly? and do´nt wait for an "dont press shift"?You can send a key dependending on any combination you like. The problem with Send can be that it doesn't allow for the state of a modifier key to change after the Send starts and before the Send finishes. If you have this HotKeySet("+k","ff1") HotKeySet("{ESC}","quit") while 1 sleep(50) WEnd func ff1() send("asdfghjklqwertyu") EndFunc func quit() Exit EndFunc If you release the shift key quickly after pressing 'k' the shift will stay locked down until you press and release it again. As long as you understand what goes wrong and in what circumstances then you can work around it. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now