Jump to content

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

On-Screen Keyboard


  • Please log in to reply
32 replies to this topic
Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
This script creates a small keyboard at the bottom of your screen which shows you which keys you have pressed. I made it to help me to learn to touch-type so I get used to not looking at the keyboard. I looked for a program that would do this but couldn't find one so I decided to make one. I haven't added all the buttons but I will add more later. I've added the main ones though. It may look a bit large on a lower resolution setting ,. I have got quite a high one.

Hide/Show/Exit via tray menu

Requires Autohotkey 1.0.23+

[code=auto:0]Menu, Tray, Add, Show
Menu, Tray, Add, Hide
Menu, Tray, Add, Exit
Menu, Tray, NoStandard

Gui, -Caption +E0x200 +ToolWindow
Gui, Color, F1ECED

;Adds Number Buttons

i=1
x=56

loop, 9
{
Gui, Add, Button, x%x% y20 w30 h30, %i%
i++
x+=32
}

;Adds keyboard Buttons


Gui, Add, Button, x%x% y20 w30 h30, 0

Gui, Add, Button, x71 y52 w30 h30, Q
Gui, Add, Button, x103 y52 w30 h30, W
Gui, Add, Button, x135 y52 w30 h30, E
Gui, Add, Button, x167 y52 w30 h30, R
Gui, Add, Button, x199 y52 w30 h30, T
Gui, Add, Button, x231 y52 w30 h30, Y
Gui, Add, Button, x263 y52 w30 h30, U
Gui, Add, Button, x295 y52 w30 h30, I
Gui, Add, Button, x327 y52 w30 h30, O
Gui, Add, Button, x359 y52 w30 h30, P

Gui, Add, Button, x84 y84 w30 h30, A
Gui, Add, Button, x116 y84 w30 h30, S
Gui, Add, Button, x148 y84 w30 h30, D
Gui, Add, Button, x180 y84 w30 h30, F
Gui, Add, Button, x212 y84 w30 h30, G
Gui, Add, Button, x244 y84 w30 h30, H
Gui, Add, Button, x276 y84 w30 h30, J
Gui, Add, Button, x308 y84 w30 h30, K
Gui, Add, Button, x340 y84 w30 h30, L
Gui, Add, Button, x372 y84 w30 h30, `;

Gui, Add, Button, x34 y116 w30 h30, Shift
Gui, Add, Button, x66 y116 w30 h30, \
Gui, Add, Button, x98 y116 w30 h30, Z
Gui, Add, Button, x130 y116 w30 h30, X
Gui, Add, Button, x162 y116 w30 h30, C
Gui, Add, Button, x194 y116 w30 h30, V
Gui, Add, Button, x226 y116 w30 h30, B
Gui, Add, Button, x258 y116 w30 h30, N
Gui, Add, Button, x290 y116 w30 h30, M
Gui, Add, Button, x322 y116 w30 h30,`,
Gui, Add, Button, x354 y116 w30 h30, .
Gui, Add, Button, x386 y116 w30 h30, /

Gui, Add, Button, x145 y148 w195 h30, Space

;Positions keyboard


ControlGetPos,,, dW, dH, SysListView321, ahk_class Progman

dw/=2
dw-=225

dh-=190

Gui, Show, x%dw% y%dh% h185 w450, Keyboard

WinSet, AlwaysOnTop, On, Keyboard

WinSet, TransColor,F1ECED 220, Keyboard

;Sets all keys as hotkeys see asciitable.com

n=1

ASCII = 46

Loop
{
Transform, Char, Chr, %ASCII%
StringUpper, Char, Char

if ASCII <> 32
if char not in <,>,^,~,

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Wow, that's pretty amazing. I can see why the instant feedback is a great help while typing because you can keep your eyes on the screen. And your use of a transparent background is a great bonus.

Thanks for sharing it.

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Really cool, its fantastic. Lol I wish I had something like this when I was learning touchtyping :p

It would be cool to have a line of text showing the most recent keys pressed, a small suggestion.

Once again tyvm for sharing it :D

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
How would I make this work with the Send command of another script? Currently, it doesn't work with my half-keyboard script, or any other send command for that matter. Would it help to disable the hook on the half-keyboard?

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
The reason it doesn't work is that the above script uses pass-through hotkeys, which are a feature of the keyboard hook. As a side-effect, the keyboard hook is designed to ignore hotkey activations triggered by any script's use of the Send command.

You would probably have to modify the script above to use the Input command rather than a series of single-character hotkeys.

exhueydriver
  • Members
  • 51 posts
  • Last active: Sep 07 2005 07:07 PM
  • Joined: 12 Jul 2004
This program, and the people on this forum never cease to amaze me!
Since I haven't had the time to study up on the gui stuff, can you tell me
how to make the "Home" keys(F & J) a different color, or underline them?
When it comes to touch typing, I REALLY need help.
Thanks
Don

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
its so cool to look at!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --
Stumbled over an AHK version conflict. Would have been smart to provide a note that this script works with >= 1.0.23+ :wink:


---------------------------
JonsTypist.ahk
---------------------------
Error: Parameter #1 is not a valid WinSet attribute.

Specifically: TransColor

Line#
061: Gui,Add,Button,x145 y148 w195 h30,Space

066: ControlGetPos,,,dW,dH,SysListView321,ahk_class Progman

068: dW /= 2

069: dW -= 225

071: dH -= 190

073: Gui,Show,x%dw% y%dh% h185 w450,Keyboard

075: WinSet,AlwaysOnTop,On,Keyboard

---> 077: WinSet,TransColor,F1ECED 220,Keyboard


The program will exit.
---------------------------
OK
---------------------------


Thx for listening.

8)

Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
Thanks for your comments :)


It would be cool to have a line of text showing the most recent keys pressed, a small suggestion.


That's a good idea, I'll try and add it (as soon as I work out the best way to implement it). I also noticed that it is hard to watch the keyboard and what you are typing at the same time.


Stumbled over an AHK version conflict. Would have been smart to provide a note that this script works with >= 1.0.23+


Thanks, I'll edit my post.

Wingfat
  • Members
  • 937 posts
  • Last active: Oct 14 2015 04:20 PM
  • Joined: 23 Aug 2004
very functional! i know of a few people that are going to love this. A freind of mine was just asking if the Onscreen Keyboard in WinXP could do the same thing.
- - - - -
Could be me but the shift only shows a down status when combined with another key. Should it not show that it is being pressed with out having to press another key. not a big deal though.
- - - - - -
----------------------------
Wingfool you fat! I mean, Wingfat you fool!
Line from Woody Allen's movie "What's Up Tiger Lilly?"
-----------------------------

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
The screen was indeed too big for mine, and I am already an excellent typist anyway. But I thought I'd like it better if it displayed one key at a time, rather than the enitre keyboard at once. Here I've modified the code to show the key in the top left of the screen. It is very rudimentary and has an untold number of bugs, but it will work if you press one key at a time slowly. I wouldn't use this, but I'm just throwing this in if someone else wants to run with it.

[code=auto:0];Sets all keys as hotkeys see asciitable.com

n=1

ASCII = 46

Loop
{
Transform, Char, Chr, %ASCII%
StringUpper, Char, Char

if ASCII <> 32
if char not in <,>,^,~,

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Besides the coolness factor, do you all think this script would interest 10% or more of site visitors, and thus should be posted in the script showcase? This is assuming Jon would want it posted there.

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Well, like I said, I don't use it, but others may find it to be quite useful. Like I said, for lower resolutions it is a bit intrusive. However, I find the ASCII hotkey code to be very interesting. I'm trying to think of more applications for using ASCII to code hotkeys, especially because it would make scripts such as this, including my half-keyboard script, more efficient and less tedious to write. You could post it just for that, to show that new, creative ways to make hotkeys other than "^X::" are possible. Also, there's the coolness factor.

Gre
  • Members
  • 74 posts
  • Last active: Nov 22 2004 06:23 AM
  • Joined: 12 Oct 2004
Tryed this script now,it is really nice.I think it is a good one to be posted in the showcase

BoBo
  • Guests
  • Last active:
  • Joined: --
Yep, showcase.

As an innovative tool/script shows AHK's power. Thought about if it would make sense to classify script samples with keywords and/or a download rating ? This way the popularity of a script could be identified easily.

8)