Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[Function] KeyHistoryExtended() - pseudo-realtime logging


  • Please log in to reply
2 replies to this topic
Tester
  • Members
  • 48 posts
  • Last active: Feb 07 2011 01:34 PM
  • Joined: 06 Jul 2006
Because now I troubleshoot some complicated keyboard+mouse chords, then I often launch KeyHistory window. But it lacks of realtime feedback. So I wrote this simple function for refreshing KeyHistory window without use of keyboard (which of course would be logged too).
KeyHistoryExtended()	{
			IfWinNotExist, %A_Space%- AutoHotkey v
				KeyHistory
			else	{
				SetTitleMatchMode, 2
				SetTimer, KeyHistoryExtendedTimer, 20
			}
}

KeyHistoryExtendedTimer:
	PostMessage, 0x111, 65410, 0,, %A_Space%- AutoHotkey v
	IfWinNotExist, %A_Space%- AutoHotkey v
		SetTimer, KeyHistoryExtendedTimer, Off
return

Example of usage:
#F9::KeyHistoryExtended()
Press above hotkey twice to turn on pseudo-realtime logging for KeyHistory window. And close KeyHistory window to turn realtime logging off.

The main drawback is that this window now continously stole focus. If anyone have idea how to prevent this then post some suggestions.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Here is another version.

Tester
  • Members
  • 48 posts
  • Last active: Feb 07 2011 01:34 PM
  • Joined: 06 Jul 2006
Great, it is much better, thanks.