That seemingly was the easy part, and thanks for the tip.
The actual entering of the number to make it behave as if a user typed it
wasn't so much.
A couple of these lines may wrap in your Email.
sub useNumber(i)
dim win, ch, j, k
set win = focusedWindow.parent
if not win is nothing then
set ch = win.children
for j = 1 to ch.count
if ch(j).control.ID = 102 then
set win = ch(j)
win.focus
j = win.control.cursor
k = len(win.control.text)
if k < 13 then
' The field only should accept up to 13 characters
Win.Control.Text = left(win.Control.Text,j) & i & right(win.Control.Text,
k - j)
speak i
win.Control.Cursor = j + 1
end if
exit for
end if
next
end if
end sub
J.J> Meddaugh - ATGuys.com
Your Assistive Technology Experts
----- Original Message -----
From: "Stephen Clower" <[email protected]>
To: <[email protected]>
Sent: Tuesday, October 19, 2010 9:49 PM
Subject: Re: Handling Characters from Within a Dialog
J.J.,
Try hooking OnChildActivate and OnChildDeactivate from the desktop window.
E.G.
ConnectEvent DesktopWindow, "OnChildActivate", "OnChildActivate"
ConnectEvent DesktopWindow, "OnChildDeactivate", "OnChildDeactivate"
Sub OnChildActivate(oWindow)
'... if this is your dialog, register hotkeys.
End Sub
Sub OnChildDeactivate(oWindow)
'... If this isn't your dialog and you have already registered hotkeys,
unregister now.
End Sub
HTH.
Steve
On 10/19/2010 9:41 PM, J.J. Meddaugh wrote:
Hello. I want to add an event in my dialog where if a number is pressed,
focus is moved to a particular field and the number is entered.
I looked at the immed script since I know it uses select all as a key
from within the window. I see the idea would be to register a hotkey (or
in this case 10) from within the dialog and dump them once the dialog is
closed.
It's the unregistering part that confuses me. I notice that the selectAll
key is unregistered for the dialogClosing event which I assume is as the
dialog is closing, go figure. But what about if the dialog loses focus?
Is this being accounted for in this script or is there another event to
watch for? Obviously, I only want these numbers to work from within the
dialog box.
Thanks for any help.
J.J> Meddaugh - ATGuys.com
Your Assistive Technology Experts