
-----------------------------------
QuantumPhysics
Fri Jun 22, 2012 9:08 pm

English to russian translation while keyevents are pressed
-----------------------------------
I want to make a program in a windows application that translates keyboard english letters and outputs russian letters when they are pressed. I have tried many methods. What I ask in this question is. How do i check if a certain letter is pressed on the keybaord. And if that letter is pressed. Then I want to translate that letter to a russian letter and output to screen. I got the translation part nailed, but i dont know how to check key movements on the keyboard. Please help!

Here is what I got so far; I started 4minutes ago.


#include 
/* windows console translate and libraries.
#include 
#include 
*/

/* My key stroke simulations
#define KEYDOWN(vkey) (GetAsyncKeyState(vkey) & 0x8000)
#define KEYUP(vkey) !KEYDOWN(vkey)
*/

using namespace std;
int main (){
// constantly loop the program after every key stroke
bool i = true;
while (i = true){
// gets the key stroke
int x;
cin >> x;

// what i got so far from the key check... ps (this is from previous knowledge, i never actually did something like this before
if ((GetAsyncKeyStatesyncKeyState('a'))) {
        cout 