on-screen keyboard

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jan 2006
Posts: 16
Reputation: Katrix36 is an unknown quantity at this point 
Solved Threads: 0
Katrix36 Katrix36 is offline Offline
Newbie Poster

on-screen keyboard

 
0
  #1
Jan 7th, 2006
Hey,

I'm trying to create a on-screen keyboard for a group of disabled students at a school. So far i've managed to create the program to type out each letter/number that the user clicks on. This is fine, but I have to state the name of the active window that the text/numbers get printed.

Would anyone know how I could send a keystroke from my program to a program like Microsoft Word, Internet Explorer, Microsoft Publisher etc?

I know Microsoft Windows XP has one built in, but the keys/letters are too small for the students to press because of there conditionss. So could someone please help me.

Katrix36
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 44
Reputation: Ooble is an unknown quantity at this point 
Solved Threads: 6
Ooble's Avatar
Ooble Ooble is offline Offline
Light Poster

Re: on-screen keyboard

 
0
  #2
Jan 7th, 2006
Check out the SendKeys function - it's part of the Win32 API.
Pascal and Delphi Syntax (Toggle Plain Text)
  1. while(sleeping)
  2. cat_wails();
  3. wake_up();
  4. for(i=0;i<9;i++)
  5. shoot_cat();
  6. rejoice();
  7. goto(bed);
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 16
Reputation: Katrix36 is an unknown quantity at this point 
Solved Threads: 0
Katrix36 Katrix36 is offline Offline
Newbie Poster

Re: on-screen keyboard

 
0
  #3
Jan 8th, 2006
Thank you for the code, but I have already tryed that. I'm wanting to on-screen keyboard to send a keystroke to a non-active window, just like the one built into windows xp.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 44
Reputation: Ooble is an unknown quantity at this point 
Solved Threads: 6
Ooble's Avatar
Ooble Ooble is offline Offline
Light Poster

Re: on-screen keyboard

 
0
  #4
Jan 8th, 2006
The SendKeys function sounds to be what you want. You'll need to get the handle of the last window to be focused, and send the keys directly to it. Unfortunately, I haven't done any Win32 programming in a while, so I'm not quite sure how you would go about it... hopefully someone with more than half a brain will come along and pull me out of this hole.
Pascal and Delphi Syntax (Toggle Plain Text)
  1. while(sleeping)
  2. cat_wails();
  3. wake_up();
  4. for(i=0;i<9;i++)
  5. shoot_cat();
  6. rejoice();
  7. goto(bed);
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: on-screen keyboard

 
0
  #5
Jan 9th, 2006
Only the window that has keyboard focus can receive keyboard events AFAIK.
You'll have to instead create some interface that will allow the virtual keyboard to send data to your application forms and fill them that way, working outside the Windows message dispatcher system.

Maybe it's changed though, I've not done any Win32 API programming in quite a while.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 16
Reputation: Katrix36 is an unknown quantity at this point 
Solved Threads: 0
Katrix36 Katrix36 is offline Offline
Newbie Poster

Re: on-screen keyboard

 
0
  #6
Jan 10th, 2006
Thank you for all your help
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC