Jump to content

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

[HotShow 1.0] - OSD Hotkeys for Video Tutorials


  • Please log in to reply
10 replies to this topic
RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
Hi guys.

I just finished the first stage of my program HotShow.
The program simply displays hotkeys pressed in a very elegant window, for use in video tutorials.

Is a personal project. I will use it to create video tutorials but I thought it might come handy to other people as well and actually maybe you can extract any code that you would like to use for other purposes.

The Background image can be downloaded from here:
<!-- m -->http://img153.images...3006/bgblue.png<!-- m -->

Or just use the compiled version which has it integrated.
Compiled version can be downloaded from here:
<!-- m -->http://www.megaupload.com/?d=QKXVENJO<!-- m -->

/*
			-------------------------------------------------------
								HotShow 1.0
			-------------------------------------------------------

			This program will show any pressed key or combination 
			of keys on screen in a very elegant way.
			
			Perfect for people who creates video tutorials
			and want to show which hotkeys they press during
			a demostration of the software being used.

----[Author]--------------------------------------------------------
This program was created by RaptorX
Thanks to Tidbit and Titan for help in some of the functions
----[Features]------------------------------------------------------
Right now the program is in its basic form.
Features will be added soon, Please read the To Do  list
----[TODO]----------------------------------------------------------
Customization of: 
-Background Image
-Transparency settings
-Fade in/Fade out settings
-Window Positioning options
--------------------------------------------------------------------
*/
#SingleInstance Force
#NoEnv
OnExit, Clean

FileInstall, BG-Blue.png, BG-Blue.png, 1

Gui, +owner +AlwaysOnTop +Disabled +Lastfound -Caption 
Gui, Color, FFFFFF
Gui, Add, Picture,,BG-Blue.png
WinsetTitle,Background 
Winset, transcolor, FFFFFF 0

Gui, 2: +Owner +AlwaysOnTop +Disabled +Lastfound -Caption
Gui, 2: Color, 026D8D
Gui, 2: Font, Bold s15 Arial
Gui, 2: Add, Text, Center CWhite W250 vHotkeys,
WinsetTitle,HotkeyText
Winset, transcolor, 026D8D 0

Gui, Show, Hide
Gui, 2: Show, Hide

Loop, 95
{
	key := Chr(A_Index + 31)
	Hotkey, ~*%key%, Display
}

Display:
If A_ThisHotkey =
	Return

mods = Ctrl,Shift,Alt,LWin,RWin
prefix =

Loop, Parse, mods,`,
{
	GetKeyState, mod, %A_LoopField%
	If mod = D
		prefix = %prefix%%A_LoopField% +
}

StringTrimLeft, key, A_ThisHotkey, 2
if key=%a_Space%
	key=Space
Gosub, Show
Return

Show:
Alpha=0
Duration=150
Imgx=23
Imgy=630

GuiControl, 2: Text, Hotkeys, %prefix% %key%
Gui, Show, x%imgx% y%imgy% NoActivate
imgx-=10
imgy+=15
Gui, 2: Show, x%imgx% y%imgy% NoActivate

Gosub, Fadein
Sleep 2000
Gosub, Fadeout
Gui, Hide
Gui, 2: Hide
Return

Fadein:
Loop, %duration%
{
	Alpha+=255/duration
	Winset, transcolor, FFFFFF %Alpha%, Background
	Winset, transcolor, 026D8D %Alpha%, HotkeyText
}
Return

Fadeout:
Loop, %duration%
{
	Alpha-=255/duration
	Winset, transcolor, FFFFFF %Alpha%, Background
	Winset, transcolor, 026D8D %Alpha%, HotkeyText
}
return

Clean:
FileDelete, BG-Blue.png
ExitApp

~*Esc::Goto, Clean

/*
-[Created By]-------------------------------------------------------
						 -RaptorX-
						 
This project can be modified or copied, for personal or commercial
uses provided that you mention the original author.
--------------------------------------------------------------------
*/

As I said this is just a quick code for my personal use but i plan to make it more customizable... different backgrounds, fade times, position and all the other parameters.

Feel free to suggest features or even optimize the code since i am not a great coder yet. :D

Code Update:
---------------------------------------------------------------------------

/*
			-------------------------------------------------------
								HotShow 1.0
			-------------------------------------------------------

			This program will show any pressed key or combination 
			of keys on screen in a very elegant way.
			
			Perfect for people who creates video tutorials
			and want to show which hotkeys they press during
			a demostration of the software being used.

----[Author]--------------------------------------------------------
This program was created by RaptorX
Thanks to Tidbit and Titan for help in some of the functions
----[Features]------------------------------------------------------
Right now the program is in its basic form.
Features will be added soon, Please read the To Do  list
----[TODO]----------------------------------------------------------
Customization of: 
-Background Image
-Transparency settings
-Fade in/Fade out settings
-Window Positioning options
-A Function that if the program detects a word instead of a shortcut it will wait for what you typed and then display the whole word/sentence at once.
--------------------------------------------------------------------
*/
#SingleInstance Force
#NoEnv
OnExit, Clean

FileInstall, BG-Blue.png, BG-Blue.png, 1 ;Background Image
FileInstall, BG-Red.png, BG-Red.png, 1

;These are the windows for the background image, created to be able to create the fade in / fade out effects
Gui, +owner +AlwaysOnTop +Disabled +Lastfound -Caption 
Gui, Color, FFFFFF
Gui, Add, Picture,,BG-Red.png
WinsetTitle,Background 
Winset, transcolor, FFFFFF 0

Gui, 2: +Owner +AlwaysOnTop +Disabled +Lastfound -Caption
Gui, 2: Color, 026D8D
Gui, 2: Font, Bold s15 Arial
Gui, 2: Add, Text, Center CWhite W250 vHotkeys,
WinsetTitle,HotkeyText
Winset, transcolor, 026D8D 0

Gui, Show, Hide
Gui, 2: Show, Hide

;End of background windows, both are hidden until we press a key

;This loop includes all the alphanumerical characters using the ascii code.
; Code 32 = Space until code 127 = Delete
Loop, 95
{ 
	key := Chr(A_Index + 31)
	Hotkey, ~*%key%, Display
}

Loop, 24 ;Support for function Keys F1-F24
{
	Hotkey, ~*F%a_index%, Display
}

Hotkey, ~*Numpad0, Display ;Adding Numpad0
Loop, 9 ;Support for Numpad Numbers
{
	Hotkey, ~*Numpad%a_index%, Display
}

NumpadKeys=NumpadDiv,NumpadMult,NumpadAdd,NumpadSub,NumpadEnter ; Support for Numpad operands.

Loop, Parse, NumpadKeys,`,
{
	Hotkey, ~*%a_loopfield%, Display
}

Otherkeys=Tab,Enter,Esc,BackSpace,Del,Insert,Home,End,PgUp,PgDn,Up,Down,Left,Right,ScrollLock,CapsLock,NumLock,Pause

Loop, parse, Otherkeys, `,
{
	Hotkey, ~*%a_loopfield%, Display
}

Display:
If A_ThisHotkey =
	Return

;Msgbox, %a_thishotkey%

mods = Ctrl,Shift,Alt,LWin,RWin
prefix =

Loop, Parse, mods,`,
{
	GetKeyState, mod, %A_LoopField%
	If mod = D
		prefix = %prefix%%A_LoopField% +
}

StringTrimLeft, key, A_ThisHotkey, 2
if key=%a_Space%
	key=Space
Gosub, Show
Return

Show:
Alpha=0
Duration=150
Imgx=23
Imgy=630

GuiControl, 2: Text, Hotkeys, %prefix% %key%
Gui, Show, x%imgx% y%imgy% NoActivate
imgx-=10
imgy+=15
Gui, 2: Show, x%imgx% y%imgy% NoActivate

Gosub, Fadein
Sleep 2000
Gosub, Fadeout
Gui, Hide
Gui, 2: Hide
Return

Fadein:
If faded=1 ;Do not fade if the window already faded in.
{
	Winset, transcolor, FFFFFF 255, Background
	Winset, transcolor, 026D8D 255, HotkeyText
	return
}

Loop, %duration% ; Fade in routine.
{
	Alpha+=255/duration
	Winset, transcolor, FFFFFF %Alpha%, Background
	Winset, transcolor, 026D8D %Alpha%, HotkeyText
	faded=1
}
Return

Fadeout:
Loop, %duration% ; Fade out routine
{
	Alpha-=255/duration
	Winset, transcolor, FFFFFF %Alpha%, Background
	Winset, transcolor, 026D8D %Alpha%, HotkeyText
	faded=0
}
return

Clean:
FileDelete, *.png
ExitApp

~*Esc::Goto, Clean
Pause::Suspend, toggle
/*
-[Created By]-------------------------------------------------------
						 -RaptorX-
						 
This project can be modified or copied, for personal or commercial
uses provided that you mention the original author.
--------------------------------------------------------------------
*/


tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008
quite handy :_)

you know my suggestions, but here they are again:
[*:32ez680x]F1-F12 support
[*:32ez680x]numberpad support
[*:32ez680x]Mouse support
[*:32ez680x]Popup at mouse (offset a bit) instead of fixed position.
[*:32ez680x]better update system (can easily out-type this version).
ps, sites that have a "wait" like megaupload & rapidshare are lame. use a better host, like <!-- m -->http://www.Autohotkey.net<!-- m --> or one of the many other good upload sites.

rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .


ruespe
  • Members
  • 567 posts
  • Last active: Dec 01 2014 07:59 PM
  • Joined: 17 Jun 2008

quite handy :_)

you know my suggestions, but here they are again:
[*:q7w8eqrp]F1-F12 support
[*:q7w8eqrp]numberpad support
[*:q7w8eqrp]Mouse support
[*:q7w8eqrp]Popup at mouse (offset a bit) instead of fixed position.
[*:q7w8eqrp]better update system (can easily out-type this version).
ps, sites that have a "wait" like megaupload & rapidshare are lame. use a better host, like <!-- m -->http://www.Autohotkey.net<!-- m --> or one of the many other good upload sites.

Yes, very nice. And I agree with tidbit. Plus
[*:q7w8eqrp]Enterkey support
[*:q7w8eqrp]Cursorkey support
[*:q7w8eqrp]Specialkey support (Tab, Del, BS, Home...)

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
Good, I will be working on that soon, I will make it optional to have the window display at mouse position and I will for sure add support for the other keys. Thanks for the feed back guys!

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
The code was updated, support for numpad keys, arrows and other buttons like home, insert, delete was added.

Removed fade in when a previous key was pressed, that removes the out-typing problem but still if you type too fast you wont be able to see what you wrote because it will be too fast.

I will add functionality that if the program detects a word instead of a shortcut it will wait for what you typed and then display the whole word/sentence at once.

Support for mouse clicks will be added soon.
Code updated in the Original Post.

  • Guests
  • Last active:
  • Joined: --
FileDelete, *.png
...WOW...do you know how dangerous that line is?

1st of all, why delete all the pngs on exit anyway?

2nd, why delete ALL pngs?...instead of listing the ones you created?

-RaptorX-
  • Guests
  • Last active:
  • Joined: --
that only works on the working directory, so basically only the png's that i created are the ones deleted.

Besides that is a little old code... i am sure i made tons of mistakes :)

  • Guests
  • Last active:
  • Joined: --

that only works on the working directory

...yes, so if my working dir is the Desktop...or somewhere else important, it would wipe all the pngs.

Besides that is a little old code... i am sure i made tons of mistakes :)

...I've been watching Blender Tutorials on YouTube & people have been neglecting to say what keys they are pressing, so I wanted to make a "Key OSD"...but then I decided to Google 1st & found this & one other script. I was about to download your code, to test it out, then I saw that line & decided not to try it yet, not without going over every line & making sure it was safe.

Just FYI: that "bgblue.png" on imageshack.us is failing now.

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010

that only works on the working directory

...yes, so if my working dir is the Desktop...or somewhere else important, it would wipe all the pngs.

Besides that is a little old code... i am sure i made tons of mistakes :)

...I've been watching Blender Tutorials on YouTube & people have been neglecting to say what keys they are pressing, so I wanted to make a "Key OSD"...but then I decided to Google 1st & found this & one other script. I was about to download your code, to test it out, then I saw that line & decided not to try it yet, not without going over every line & making sure it was safe.

Just FYI: that "bgblue.png" on imageshack.us is failing now.


i will upload a newer version of the script soon. maybe you will want to take a look at that one. :D

thanks for pointing out i will update it.
AutoHotkey Toolkit [Main Project]
Scintilla Wrapper
LexAHKL

fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
The downloads are offline.

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011

i will upload a newer version of the script soon. maybe you will want to take a look at that one. grin.png

 
 
bump!? happy.png
 

FileDelete, *.png
...WOW...do you know how dangerous that line is?


and yes this is ridiculous, I created the script on my desktop and now half of my images are deleted lol