How To Input Chinese Using Key Baord

Posted on by  admin

By default, the Language bar appears in the taskbar along the bottom of a Windows screen upon registration of two or more keyboard layouts. The Language bar will not be shown if only one language is registered or if a user has elected to hide it. To switch keyboard layouts using the Language bar, click on the language abbreviation on the screen.

BaordHow To Input Chinese Using Key Baord

How To Input Chinese In Windows 7

I'm wondering how to accept keyboard and mouse input in C++, using Visual Studio 2010, for Windows 7 32-bit.

--EDIT: I forgot to mention that I need keyboard / mouse input without interrupting the flow of the program. Something like a listener. I don't want to have to pause the program and ask for input, and then have the user type it out and press enter. What I'm looking for is more like:

If user presses W, S, A, D -> something happens.

Or: If user presses leftmousebutton in -> something happens.

I have to mention that I'm still very new to programming as a whole. I know basic OOP programming but that's about it. I'm definitely sure that this will involve things I don't know about yet, and I don't mind, I just ask that you explain it thoroughly, and possibly give an example so I know how to use it.

Thanks.

How to input chinese using key baord for beginnersEmilio Garavaglia
17.1k1 gold badge36 silver badges51 bronze badges
RohitRohit

4 Answers

keyboard / mouse input without interrupting the flow

Software_DesignerSoftware_Designer
6,8963 gold badges18 silver badges24 bronze badges

There are a number of related concepts behind this.

At the very low level, the keyboard and the mouse are hardware devices that generates some 'interrupts' (in the form of electric signals) to the CPU.The operating system provides some drivers that handle such interrupts by decoding the device communication specific protocol, and 'standardizing' (at OS level) those signals in the form of events.

With 'console applications', the operating system handles those events (the keyboard in particular) by filling up an input buffer (essentially a char[]) that is made accessible as a 'virtually infinite sequence of characters' (complicated name for 'file') named 'CON', thus mimicking the 'infinite teletype model' of the early days computers. In a C++ program, the standard library -at program startup- associates to that 'file' the std::cin and std::coutstream objects, so you can read the input character sequence using the std::istream functions and operators.

With 'graphical applications', unfortunately, there is no 'early days model' to mimic, and 'events' are left available as the operating system native structure.Different operating system differs in the way such events are represented and handled, but certain similitude can be seen.For Windows (since your question is about), a typical program retrieves those events in sequence with a 'message loop' in which calling certain OS APIs.In that loop, the typical program will also give call another OS API to dispatch those event to appropriate 'call-back' procedure, associated to a previously created 'window'.That callback procedure has to detect the event code, cast the parameter as appropriate and manage them doing the action required.

A more precise detail can be seen with a WIN32 programming tutorial like http://www.winprog.org/tutorial/.The most of the code is essentially C, since C is the language the API are formalized.For C++, a number of libraries have then been written to represent OS objects is the form of C++ classes, and mapping the OS APIs to those classes members.These libraries can be either OS specific (like MFC, WTL ...) or 'multi-platform' (they exist in different version, mapping the API of various OSs into a same C++ interface) like WxWidget, Qt, Gtk, Fltk ...

Hope this can give you more hints to think about.

Emilio GaravagliaEmilio Garavaglia
17.1k1 gold badge36 silver badges51 bronze badges

If you're writing a console application, you can use scanf or cin to get keyboard input. Console applications don't have any support for the mouse.

If you're writing a GUI application, you'll build the app out of standard windows controls that have built-in behaviors for mouse and keyboard input. You can use these re-usable controls as is, or you can augment them to make them behave exactly how you want for your application.

For example, in a GUI application, there's a standard edit control you can use that the user can type into. Your program receives messages when the user enters text into it, and based on those messages, or on other events, you can retrieve the text and do things with it as required by your program.

ColenColen
6,18816 gold badges66 silver badges101 bronze badges
ildjarn
56.9k8 gold badges107 silver badges191 bronze badges

How To Type In Chinese

Triton ManTriton Man
12.1k16 gold badges60 silver badges92 bronze badges

Not the answer you're looking for? Browse other questions tagged c++inputkeyboardmouse or ask your own question.

Comments are closed.