| View previous topic :: View next topic |
| Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Jul 07, 2009 12:24 pm Post subject: On-screen Keyboard |
|
|
Is there a way in VDS to make an on-screen keyboard? I'm pretty sure that I can make one that'll work with most apps using window send, but I need to be able to work with a web browser to send the keystrokes to an edit box on a webpage (or any other control on a webpage). I have not been able to do that. Can anyone help, any ideas?
Thanks _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
briguy Contributor

Joined: 09 Aug 2007 Posts: 79
|
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Jul 07, 2009 1:23 pm Post subject: |
|
|
I'm pretty sure that it can be done w/o a browser helper object to make the OSK. It was done using autohotkey http://www.autohotkey.com/forum/topic18378.html , so hopefully it can be done in VDS. Now targeting a specific edit box without it having focus is a different matter. As long as the edit box has focus sending text to that should be able to be done... I hope.  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
briguy Contributor

Joined: 09 Aug 2007 Posts: 79
|
Posted: Tue Jul 07, 2009 1:34 pm Post subject: |
|
|
| I couldnt download and test this keyboard at work. Are you saying you can send keys to a IE window? |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Tue Jul 07, 2009 1:39 pm Post subject: |
|
|
Yes, that Autohotkey OSK does send keystrokes to IE and any other program. It works very nicely. I may modify the code to use myself, but would rather use VDS to make it. I am going to look at the AHK code and see if I can find a way to make it in VDS. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 08, 2009 12:08 am Post subject: |
|
|
LiquidCode,
You could run the program osk.exe which comes with Windows? It is part of the accessibility system of Windows. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Jul 08, 2009 1:09 am Post subject: |
|
|
It is for a client that wants a OSK and to be able to customize it. They don't want the F1 keys and a few others as well as not allowing it to be moved. The one that comes with windows can't be customized that I know of. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 08, 2009 12:53 pm Post subject: |
|
|
Well I guess your stuck with building your own in VDS then. It really would not be that hard. Just grab the last active window before sending the key. The way you would grab the last active window is to hook the WM_ACTIVATE API message. This message has the previous window ID in the lParam. Also you may want to use a dictionary such as the one in GadgetX to do word predictions as the user is using your OSK  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Jul 08, 2009 6:12 pm Post subject: |
|
|
Well, I was able to get it to work kind of. It works for a little then stops. It seems to start to lag over a short period of time. I don't know why or how to fix it. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Jul 09, 2009 1:12 pm Post subject: |
|
|
| LiquidCode wrote: | | Well, I was able to get it to work kind of. It works for a little then stops. It seems to start to lag over a short period of time. I don't know why or how to fix it. |
What works for a short time? What starts to lag? _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Jul 09, 2009 1:18 pm Post subject: |
|
|
My on screen keyboard. I made one with only a few buttons, when I press them, the letter/numbers are sent to the active window but after a short while it takes longer for the letters/numbers to send. I would press the button on the OSK and it would take longer for the key to send. I'll try to post my code on here later today so you can try it. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Jul 09, 2009 1:47 pm Post subject: |
|
|
Ok, here is the code. I can't seem to get it right. Hopefully someone can help. It has a problem with address bars and doesn't work when renaming a file. It does ok on browsers, but starts to slow down after a bit.
| Code: |
#define command,gosend,ReduceMemory
DIALOG CREATE,VDSOSK,-1,0,677,260,CLASS VDSOSK,ONTOP
REM *** Modified by Dialog Designer on 7/8/2009 - 14:23 ***
DIALOG ADD,GROUP,GROUP1,-7,-9,655,171,
#DIALOG ADD,BITMAP,back,0,0,565,144,#temp.bmp
DIALOG ADD,STATUS,S1,
DIALOG ADD,BUTTON,C_QUOTE_,2,2,40,40,`
DIALOG ADD,BUTTON,N_1_,2,41,40,40,1
DIALOG ADD,BUTTON,N_2_,2,80,40,40,2
DIALOG ADD,BUTTON,N_3_,2,119,40,40,3
DIALOG ADD,BUTTON,N_4_,2,158,40,40,4
DIALOG ADD,BUTTON,N_5_,2,197,40,40,5
DIALOG ADD,BUTTON,N_6_,2,236,40,40,6
DIALOG ADD,BUTTON,N_7_,2,275,40,40,7
DIALOG ADD,BUTTON,N_8_,2,314,40,40,8
DIALOG ADD,BUTTON,N_9_,2,353,40,40,9
DIALOG ADD,BUTTON,N_0_,2,392,40,40,0
DIALOG ADD,BUTTON,C_Dash_,2,431,40,40,-
DIALOG ADD,BUTTON,C_Equal_,2,470,40,40,=
DIALOG ADD,BUTTON,C_BkSpc_,2,509,40,40,BkSpc
DIALOG ADD,BUTTON,C_Del_,2,548,40,40,Del
DIALOG ADD,BUTTON,C_Up_,2,587,40,40,Up
DIALOG ADD,BUTTON,C_tab_,41,2,63,40,Tab
DIALOG ADD,BUTTON,L_Q_,41,64,40,40,Q
DIALOG ADD,BUTTON,L_W_,41,103,40,40,W
DIALOG ADD,BUTTON,L_E_,41,142,40,40,E
DIALOG ADD,BUTTON,L_R_,41,181,40,40,R
DIALOG ADD,BUTTON,L_T_,41,220,40,40,T
DIALOG ADD,BUTTON,L_Y_,41,259,40,40,Y
DIALOG SHOW
list create,1
LoadLib user32.dll
#Get id of window
%%vdsosk_id = @winexists(#VDSOSK)
:evloop
wait event,0.1
%e = @event()
option fieldsep,"_"
parse "%a;%b;%c",%e
option fieldsep,"|"
if @equal(%a,N)
%%num = %b
goto Number
elsif @equal(%a,C)
%%chr = %b
goto Char
elsif @equal(%a,L)
%%letter = %b
goto Letter
end
goto %e
:timer
if @equal(@winactive(I),%%vdsosk_id)
goto evloop
end
# Look to see if the user clicked the left mouse button
%R = @lib(user32,GetAsyncKeyState,INT:,INT:$01)
if %r
if @not(@zero(%r))
# if the OSK is the active window do nothing
if @equal(@winactive(I),%%vdsosk_id)
goto evloop
else
# Grab the active window and control
%%wa = @winatpoint(@mousepos(x),@mousepos(y))
%%aw = @winactive(C)
#dialog set,s1,%%wa | %r
end
end
end
#%%wa = "%12257086"
goto evloop
:Number
gosend %%num
goto evloop
:Letter
if %%shift
gosend @upper(%%letter)
else
gosend @lower(%%letter)
end
goto evloop
:Char
if @equal(%%chr,quote)
gosend @chr(352)
elsif @equal(%%chr,Dash)
gosend "-"
elsif @equal(%%chr,Equal)
gosend "="
elsif @equal(%%chr,BkSpc)
gosend @chr(08)
elsif @equal(%%chr,Up)
gosend @key(UP)
elsif @equal(%%chr,Del)
gosend @key(Del)
end
goto evloop
:gosend
if %%wa
#window activate,%%wa
#Use send message to send the keys to the window
%A = @sendmsg(%%wa,$06,1,0)
window send,%%wa,%1
dialog set,s1,%%aw | %%wa | @winclass(%%wa)
#window activate,%%wa
ReduceMemory
end
exit
:close
FreeLib user32.dll
stop
# --- Reduce Memory----
:ReduceMemory
loadlib "psapi.dll"
%t = @lib("psapi.dll","EmptyWorkingSet",INT:,-1)
freelib "psapi.dll"
exit
# End Redice Memory
|
_________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Jul 09, 2009 9:38 pm Post subject: |
|
|
Actually I tried and tried to get your code above to run correctly but could not. It kept loosing the previous active window. I still think automating and controlling the built in OSK.exe would be much easier...
| Code: |
run osk.exe
Repeat
%%osk_window = @winexists(#OSKMainClass)
Until %%osk_window
wait 0.1
%%osk_child = @window(%%osk_window,child)
While %%osk_child
If @Equal(@wintext(%%osk_child),F1)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F2)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F3)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F4)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F5)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F6)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F7)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F8)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F9)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F10)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F11)
WINDOW HIDE,%%osk_child
ElsIf @Equal(@wintext(%%osk_child),F12)
WINDOW HIDE,%%osk_child
End
%%osk_child = @window(%%osk_child,NEXT)
Wend
|
The code above will launch osk.exe and remove the F1 - F12 keys  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Fri Jul 10, 2009 12:19 am Post subject: |
|
|
I'll run that past my client. I don't think he'll go fir it though. He doesn't want it to be able to be moved and have the menus. The gaps might look a little odd also. This is going to be in kiosks at hotels. _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Jul 10, 2009 12:53 pm Post subject: |
|
|
Well that was only an example to show that customizing the interface of osk.exe is possible. I do know how to customize it to the point that it would stretch across the bottom of the screen and remove the titlebar and menus... The key buttons can be moved around too. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|