• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

virtual keyboard problem...urgent help required

Hi there,

here is the problem that i m currently facing...i need help immediately...

Project is "Virtual keyboard like on-screen keyboard provided by win xp"
 
Symptom)
The user can’t get more than the last key clicked into a some Text field like any combobox.
 
Behavior)
Some applications have Text Boxes that are coded to select all text in the control as soon as that control acquires focus.  This is supposed to allow the user to over-type the existing text without a “click and drag.”  If the user doesn’t want to over-type, he clicks in the field again.
 
Problem)
• The user click a field in the target window, and it becomes the Foreground Window.
• The user clicks on a on-screen keyboard key.
• on-screen keyboard gets focus and becomes the Foreground Window.
• on-screen keyboard sets the previous window back as the Foreground Window.
• The now active window gives focus to the target Text Box Control.
• on-screen keyboard “sends” a key to the target field.
• The user clicks another on-screen keyboard key.
• on-screen keyboard again gets focus and becomes the Foreground Window.
• on-screen keyboard sets the previous window back as the Foreground Window.
• The now active window gives focus to the target Text Box Control, and pre-selects
  the character we just put in it.
• on-screen keyboard “sends” the new key to the target field that promptly overwrites
  the character we just put there.
• The end result is that the user can never type more than one character into the
  target field
 

regards,
riki..


0
RikiMegha
Asked:
RikiMegha
1 Solution
 
AlexFMCommented:
Use WS_EX_NOACTIVATE extended window style for on-screen keyboard. This is the way XP on-screen keyboard working.
0
 
The_TCommented:
Maybe send 2 keys each time:
send first the key 'end' so cursor goes to line end
the send your character.

hope it works.

by the way, check out:
http://www.planet-source-code.com
there should probably be a similar program there.
0
 
Eduard GherguCommented:
Hello!

You can use the LostFocus event to store the text in a global string variable. At the begining, this variable is initialized with vbnullstring. On GotFocus event you have to set the text property with the value of global variable.

The second scenario is to detect on form_load if the Keyboard application is running. You can set a flag to true in this case. On the GotFocus event, you have to check if the flag is true before entering into the selection code and to bypass it in this case.
0
 
jacobhooverCommented:
I agree with AlexFM.  

One may also want to set the keyboard to be the "Topmost" window.  

Only other question would be what language are you using to write the virtual KB?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now