I have a smart device with windows Mobile 6.5 operating system, and i want to write an application for this device by .Net CF 3.5 and C# Language. The keybpad of this device is something look like this picture:
As you see in the top picture, texts and numbers are placed on the same key. For example 2 has “ABC” if we wanted to write anything starting with ‘A’ we need to type key 2 once. If we wanted to type ‘B’, press key 2 twice and thrice for typing ‘C’.
Q1. I can not type English letters using this keyboard, I just can type digits. I want to type English letters in text boxes (And to Persian letters). Can I do this job by keybd_event()
that is an extern
function ?
Q2. I have 3 method for input characters and at the same time one of these methods must be enabled :
In other hands in How to switch between the three methods
Q3. how to show keyboard by appropriate characters according to one of 3 input methods that described? (One time with English, another time with Persian, and another time with digits)
Regards
If the special key interpretation is only needed inside one application (Compact Framework) then possibly using SDF (SmartDeviceFramework) is the coice. See KeyTest3AKsdf on http://www.hjgode.de/wp/2012/09/20/windows-mobile-cf-how-to-catch-f1-and-f2-in-weh/
In the Message Handler you need to manage the keyboard plane (numbers, english letters, persian letters) and probably a key-pressed timeout to be able to decide if a key is pressed multiple times within a time (to produce these ABC optional outputs).
Define a key or combination to switch between the planes.
Watch the messages coming in and decide what to do. You can alter a copy of the message, post it to the message queue and return true to let windows system know that you handled the message.
You may use keybd_event for simple keys as defined in winuser.h and winuserm.h. But for extended chars this will get complicated (finding the right sequence of values). I would go with PostMessage and WM_CHAR for extended symbols and letters.
Further on you may need to install a trueype font with persian glyphs. The default english OS fimrware normally only support a subset of unicode glyphs. See also http://www.hjgode.de/wp/2011/04/06/mobile-development-a-simple-unicode-character-map/