Computer Science Canada

English to russian translation while keyevents are pressed

Author:  QuantumPhysics [ Fri Jun 22, 2012 9:08 pm ]
Post subject:  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 <iostream>
/* windows console translate and libraries.
#include <windows.h>
#include <cstdlib>
*/

/* 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 << "a" << endl;
}
// satisfy computer for reading my code and pleasure it with bits Smile
return 69;
}
}

Sorry didnt know how to "pastebin" the code

Author:  Tony [ Sat Jun 23, 2012 12:09 am ]
Post subject:  RE:English to russian translation while keyevents are pressed

Before you jump too far into the coding part... you do realize that the Russian alphabet is longer than English alphabet, right?

Author:  QuantumPhysics [ Sun Jul 01, 2012 1:20 pm ]
Post subject:  RE:English to russian translation while keyevents are pressed

[Solved] Please close this post now. Thank you.


: