forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


On-screen Keyboard
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Jul 07, 2009 12:24 pm    Post subject: On-screen Keyboard Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Tue Jul 07, 2009 12:38 pm    Post subject: Reply with quote

love to know how to do this as well but from what I've been told here by PGWARE you have to have a browser helper object.

[url]
http://www.vdsworld.com/forum/viewtopic.php?t=3988&highlight=
[/url]
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Jul 07, 2009 1:23 pm    Post subject: Reply with quote

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. Smile
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
briguy
Contributor
Contributor


Joined: 09 Aug 2007
Posts: 79

PostPosted: Tue Jul 07, 2009 1:34 pm    Post subject: Reply with quote

I couldnt download and test this keyboard at work. Are you saying you can send keys to a IE window?
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Tue Jul 07, 2009 1:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jul 08, 2009 12:08 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Jul 08, 2009 1:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jul 08, 2009 12:53 pm    Post subject: Reply with quote

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 Smile
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Jul 08, 2009 6:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Jul 09, 2009 1:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Jul 09, 2009 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Jul 09, 2009 1:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Jul 09, 2009 9:38 pm    Post subject: Reply with quote

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 Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Jul 10, 2009 12:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Jul 10, 2009 12:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group