AutoHotkey Community

It is currently May 27th, 2012, 10:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: On-Screen Keyboard
PostPosted: November 17th, 2004, 10:06 pm 
Offline

Joined: April 28th, 2004, 1:12 pm
Posts: 349
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]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 <,>,^,~,


Last edited by Jon on January 9th, 2008, 9:53 am, edited 4 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2004, 10:28 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2004, 10:37 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2004, 10:50 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2004, 11:02 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 3:50 am 
Offline

Joined: July 12th, 2004, 3:51 am
Posts: 51
Location: Fife,Wa
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 5:15 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
its so cool to look at!

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 6:21 pm 
Stumbled over an AHK version conflict. Would have been smart to provide a note that this script works with >= 1.0.23+ :wink:


Quote:
---------------------------
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)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 7:58 pm 
Offline

Joined: April 28th, 2004, 1:12 pm
Posts: 349
Thanks for your comments :)


Quote:
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.


Quote:
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 9:00 pm 
Offline

Joined: August 23rd, 2004, 10:06 pm
Posts: 276
Location: East Bay, California USA
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?"
-----------------------------


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 9:20 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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];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 <,>,^,~,


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 10:03 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2004, 11:07 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2004, 12:24 am 
Offline

Joined: October 12th, 2004, 11:34 pm
Posts: 74
Location: São Paulo ,Brazil
Tryed this script now,it is really nice.I think it is a good one to be posted in the showcase


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2004, 9:46 am 
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)


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 44 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group