AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Toddler Keyboard

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
bobbo



Joined: 19 Mar 2007
Posts: 14

PostPosted: Fri Jun 29, 2007 3:14 am    Post subject: Toddler Keyboard Reply with quote

I've got a 1-year-old boy that's just starting to bang on the keyboard to this kind of game:
http://www.fisher-price.com/fp.aspx?st=2601&e=gamesByAge&mcat=game_infant&site=us

I've also got a 4-year-old girl who's starting to move up to side-scrollers:
http://www.nickjr.com/playtime/index.jhtml

My problem was they tended to bump the Windows key, or an Alt key, etc., and the game's window lost focus. (Or the 1-year-old somehow re-arranged all the desktop icons.) I looked for a long time for a kid's keyboard, or an overlay, or something, but it just doesn't exist.

So my answer was this simple script that does just two things: (1) disables all keys except the alpha-numerics and direction keys, and (2) for a held-down key, only sends a single key-press.

Code:
; Toddler Keyboard
; v1.0 29Jun2007
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         bobbo
;
; Script Function:
;    Prevents key presses to most keys other than A-F and 0-9.
;    Useful to prevent children's games from losing window focus.
;    Also only sends key press once if held down.
;
;-------------------------------------------------

#NoEnv ;
SendMode Input ;

;key list found at: http://www.autohotkey.com/docs/KeyList.htm

;-------------------------------------------------
;KEYS NOT ALLOWED:
;-------------------------------------------------

Tab::
Escape::
Backspace::

Delete::
Insert::
Home::
End::
PgUp::
PgDn::

ScrollLock::
CapsLock::
NumLock::

F1::
F2::
F3::
F4::
F5::
F6::
F7::
F8::
F9::
F10::
F11::
F12::
F13::
F14::
F15::
F16::
F17::
F18::
F19::
F20::
F21::
F22::
F23::
F24::

AppsKey::

LWin::
RWin::

LControl::
RControl::
LShift::
RShift::
LAlt::
RAlt::

PrintScreen::
CtrlBreak::
Pause::
Break::

Help::
Sleep::

Browser_Back::
Browser_Forward::
Browser_Refresh::
Browser_Stop::
Browser_Search::
Browser_Favorites::
Browser_Home::
Volume_Mute::
Volume_Down::
Volume_Up::
Media_Next::
Media_Prev::
Media_Stop::
Media_Play_Pause::
Launch_Mail::
Launch_Media::
Launch_App1::
Launch_App2::

;not an allowed key, so do nothing
return

;-------------------------------------------------
;KEYS ALLOWED:
;-------------------------------------------------

; I chose to let these through unaffected, to allow
; for certain game control
;Up::
;Down::
;Left::
;Right::
;Space::
;Enter::

Numpad0::
NumpadIns::
Numpad1::
NumpadEnd::
Numpad2::
NumpadDown::
Numpad3::
NumpadPgDn::
Numpad4::
NumpadLeft::
Numpad5::
NumpadClear::
Numpad6::
NumpadRight::
Numpad7::
NumpadHome::
Numpad8::
NumpadUp:
Numpad9::
NumpadPgUp::
NumpadDot::
NumpadDel::
NumpadDiv::
NumpadMult::
NumpadAdd::
NumpadSub::
NumpadEnter::

;only send the key press through once if held down continually
;(use curly brackets to send these special keys)
if (A_PriorHotkey <> A_ThisHotkey or A_TimeSincePriorHotkey > 500)
{
   Hotkey, %A_ThisHotkey%, Off
   Send, {%A_ThisHotkey%}
   Hotkey, %A_ThisHotkey%, On
}
return

a::
b::
c::
d::
e::
f::
g::
h::
i::
j::
k::
l::
m::
n::
o::
p::
q::
r::
s::
t::
u::
v::
w::
x::
y::
z::

0::
1::
2::
3::
4::
5::
6::
7::
8::
9::

;only send the key press through once if held down continually
;(send the literal keys)
if (A_PriorHotkey <> A_ThisHotkey or A_TimeSincePriorHotkey > 500)
{
   Hotkey, %A_ThisHotkey%, Off
   Send, %A_ThisHotkey%
   Hotkey, %A_ThisHotkey%, On
}
return

This script has really cut down on the, "Dad, fix the computer!" calls in my house; hope you find it useful, too.
Back to top
View user's profile Send private message
Dave72



Joined: 27 Jan 2007
Posts: 26
Location: Canada

PostPosted: Fri Jun 29, 2007 4:19 am    Post subject: Reply with quote

Fantastic.. I hadnt even thought of using ahk to lock-down the wife's pc like that for our 4 yr old to use..

Ill prob compile and install it tomorrow.

Thanks for thinking outside the box !
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Fri Jun 29, 2007 11:00 am    Post subject: Reply with quote

Good idea. In the past, I had found a freeware locking the Windows key using a hook DLL, and displaying fancy graphics depending on the key hits.
I also found that Tux Paint is a nice playing field for kids...
That said, I have found (in France) keyboard covers for kids, never bought one though.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
badmojo



Joined: 11 Nov 2005
Posts: 144

PostPosted: Sat Jun 30, 2007 10:06 am    Post subject: Reply with quote

great work, bobbo! previously i used Toddler Keys but this is very good and since it's in AHK i can easily adapt it to my needs.. hope you don't mind.. Wink
Back to top
View user's profile Send private message
airjrdn



Joined: 25 Feb 2008
Posts: 35

PostPosted: Sat Mar 29, 2008 12:21 pm    Post subject: Reply with quote

Be sure to check out the KidzCD's. I mirror them on my freeware site http://www.MissingBytes.net in the Kids section, but the main site can be found at http://www.kidzcd.com

Mine are 5, 4, 1.5, & 6mo, so I've been where you are now, but the tool you put together will be very useful, thanks for taking the time to do it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group