Jump to content

Search the Community

Showing results for tags 'keypress'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 3 results

  1. Hello everybody Greetings! I am checking in the script below to see if the user has input a specific term (such CAT/cat) in a window (Notepad) #include <Misc.au3> If WinActivate("Untitled - Notepad") Then While 1 If _IsPressed("43") And _IsPressed("41") And _IsPressed("54") Then ConsoleWrite("CAT is typed" & @LF) EndIf Sleep(250) WEnd EndIf The only problem is that it will only highlight CAT written in one sitting, not CAT written over time. If the user takes the time to type CAT, it needs to be highlighted that cat was entered after they type C-A-T at T. This is a project for a playground for kids. I'm constructing for the students. Any alternative approach is welcome. Thanks!
  2. Hello, I wonder why PSlist waits for some input even when it has finished already? If I run it like this pslist.exe -s 2 in task manager mode for 2 seconds (so I have the CPU load numbers for processes) it never ends unless a key is pressed. This is useless if I want to call it from another script and have output in a file like this pslist.exe -s 2 >procs.txt because it never finishes! Anybody has an idea if anything else can be done except killing a process after some time?
  3. Hi everyone , i'm trying to make some sort of full screen console window where some of the text must be non-editable like windows CMD.exe. Text already typed before pressing enter or the working folder 'C:\...>' is read only in CMD.exe and I want to know if mimicking this behavior in an edit control is possible. My attempt to make a console makes all the [A-Za-z0-9] keys a hotkey and the main edit control is set to read only. Every time the user types something the hotkey function is triggered, the cursor in the edit control is set to the end of the text and the character you typed is added to the edit. If you try to press the {backspace} key when you are at the edge of some text that is read only nothing happens. This works but I guess it is not the best or most clean way to make something like this.. Can someone give me some advice or help me make a better function for having full control over text in the edit control? kind regards, TheAutomator #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND), $WS_EX_TOPMOST) GUISetBkColor(0x000000) $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, BitOR($ES_READONLY,$WS_VSCROLL), 0) GUICtrlSetFont(-1, 28, 400, 0, 'OCR A Extended') GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetCursor (-1, 2) _GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49) GUISetState(@SW_SHOW) ;################################################################################################################## Global $keys = 'abcdefghijklmnopqrstuvwxyz _ABCDEFGHIJKLMNOPQRSTUVWXYZ' ;################################################################################################################## For $_ = 1 To StringLen($keys) HotKeySet( StringMid($keys,$_,1), 'keypress') Next For $_ = 0 To 9 HotKeySet($_, 'keypress') HotKeySet('{numpad'&$_&'}', 'keypress') Next HotKeySet('{bs}','Keypress') HotKeySet('{enter}','Enter') _GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:') $MIN = StringLen(GUICtrlRead($Console)) + 1 $MAX = $MIN ;################################################################################################################## Func Keypress() Local $key = @HotKeyPressed If StringLen($key) = 1 Then _GUICtrlEdit_AppendText($Console, $key) $MAX += 1 ElseIf StringRegExp($key,'\{numpad[0-9]\}') Then _GUICtrlEdit_AppendText($Console, StringMid($key,8,1)) $MAX += 1 ElseIf $key = '{bs}' Then If $max = $min then Return Else Local $len = StringLen(GUICtrlRead($Console)) _GUICtrlEdit_SetSel($Console, $len - 1, $len) _GUICtrlEdit_ReplaceSel($Console, '') $MAX -= 1 EndIf EndIf EndFunc Func Enter();handle typed commands when ENTER is pressed: Switch StringStripWS(StringLower(StringMid(GUICtrlRead($Console),$min,$max)),8) Case '' Beep(1000,50) Case 'clear' GUICtrlSetData($Console,'Command:') $MIN = StringLen(GUICtrlRead($Console)) + 1 $MAX = $MIN Return Case 'quit' Quit() Case Else _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Unknown command!') EndSwitch _GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:') $MIN = StringLen(GUICtrlRead($Console)) + 1 $MAX = $MIN EndFunc ;============================================================= Func Quit() _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Goodbye...') Sleep(1500) Exit EndFunc While True If GUIGetMsg() = $GUI_EVENT_CLOSE Then Quit() EndIf WEnd
×
×
  • Create New...