Jump to content

hotkey problem


monte
 Share

Recommended Posts

after pressing the hotkey the text is sent and then the funny business starts. It keeps the control and alt keys pressed: I press the hotkey (ctrl+alt+f), it sends the text and then I press the "f" key and the text is sent again and windows is screwed up! I have to kill the script, press ctrl+alt+del, get to the windows security screen and then all is back to normal.

What's wrong when I press the hotkey? Note: everything is ok when pressing the system tray menu. Thanks for you help.

;this sends a unix / linux find command to the active window, or to notepad for testing

#NoTrayIcon

;;;;;;;;;
;hotkeys
;;;;;;;;;
HotKeySet("^!f", "find")         ;find most recent

;;;;;;
;tray
;;;;;;
Opt("TrayMenuMode",1)
$find = TrayCreateItem("Find  - ctrl alt F")
TrayCreateItem("")
$exititem      = TrayCreateItem("Exit")

TraySetState()
TraySetToolTip("Hotkeys")



While 1
  $msg = TrayGetMsg()
  Select
    Case $msg = 0
      ContinueLoop
    Case $msg = $exititem
      ExitLoop
    Case $msg = $find
      $hotkeyFlag = 1
      find()
      $hotkeyFlag = 0
  EndSelect
WEnd


;;;;;;
;find
;;;;;;
func find()
  if $hotkeyFlag = 1 then
    Run("Notepad.exe", "", @SW_MAXIMIZE)
    WinActivate("Untitled - Notepad", "")
    WinWaitActive("Untitled")
  endif
  sleep(100)
  send('find . type f mtime 1 xdev ls|awk ''{print $7, $8, $9, $10, $11}''|sort nr|head n 10' & @CR)
endfunc
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...