Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically opening the On Screen Keyboard 4

Status
Not open for further replies.

Rajesh Karunakaran

Programmer
Sep 29, 2016
535
0
16
MU
Hi,

Anyone has an idea how we can open the Windows OSK (On Screen Keyboard, osk.exe) programatically?
In fact, for example, I want to invoke OSK upon clicking a button.

Thanks
 
Mike,

I think, for me it's better to have two separate classes because in the numeric pad keyboard, I have a few extra buttons. By the way, in few of my entry controls, I added auto invoke of keyboard according to the data type expected by those controls.

Also, thank you for the code Url. Will check that.

Rajesh
 
Well,

Mike Lewis said:
feel free to ignore these suggestions

I would just second the core idea of using subclassing in general. Take alone the aspect of having a toolbar without a title (when undocked). You could create a toolbarwithouttitle class and make your two full and numpad keyboard classes based on that. I assume there would even be some code that's shared between the classes and could be centralized in a base class.

Notice that such base classes are usually not usable standalone and in themselves, but that's okay, they exist to reuse code in the write-once-use-many-times fashion.

I could imagine the major code in your toolbar is an individual KEYBOARD command in the click event of the command buttons. A general way to deal with most keys would be KEYBOARD This.caption, which only would need an override with a key like ENTER or DNARROW, as you likely won't want the real deal {ENTER} or {DNARROW} with curly brackets as the button caption. But it could still be a base class of a command button you use and then you override the click event for those keys that need another KEYBOARD command.

Chriss
 
Hi all,

I changed the design of my osk a lil bit. Below is the sample. Bit more good looking!

Untitled_b5x11k.png


Mike, I will certainly consider making all keyboard layouts into a single class. However, I have to check if I would need to manually control the sizing of the keyboard size when I programatically make a particular section disable/invisible.

Also, I want to try that link you shared for hiding title bar etc of the toolbar control. Will come back here if I find something interesting.

Chriss, yes, you're right. I have a keyboard button class in which I do all the key trappings and associated actions. As you said, there are special cases like, Backspace, Down/Up arrows, Enter etc etc and all other usual keys are identified from the label on the key.

Thanks
Rajesh
 
Rajesh,

One more little piece of feedback:

You have two buttons with very similar symbols. In fact, they are identical apart from their colour. I assume that one of them is Backspace and the other is Delete. If so, you should choose a different caption for one of them so as to make it more obvious for the user.

keyboard_rmewxf.png

Given that it seems to be OK to use English captions (as per Clear and Enter), you could perhaps label one of them Del.

Just a thought.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

Yes, the buttons are with same label character but they do the same thing, the BackSpace.
I added thinking about convenience if the user is using the Numpad side. But, in one way, it's unnecessary.
I will just make the '0' key double width and eliminate the Numpad side backspace key.

Thank you for your observation and suggestion

Rajesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top