mirror of
https://github.com/dimkouv/Linux-Keylogger.git
synced 2025-05-15 23:40:09 -07:00
bug fixes
This commit is contained in:
parent
c8133fb1ca
commit
c98fc1ce75
@ -65,6 +65,8 @@ int main(int argc, char *argv[]) {
|
|||||||
// Convert key codes to string values
|
// Convert key codes to string values
|
||||||
// ex: mappings[code] = "value"
|
// ex: mappings[code] = "value"
|
||||||
char * mappings[1024];
|
char * mappings[1024];
|
||||||
|
int i;
|
||||||
|
for (i=0; i<1024; i++) mappings[i] = "invalid";
|
||||||
generate_mappings(mappings);
|
generate_mappings(mappings);
|
||||||
|
|
||||||
|
|
||||||
@ -86,6 +88,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// Scan for key strokes and print them
|
// Scan for key strokes and print them
|
||||||
while (1){
|
while (1){
|
||||||
int key_code = get_key_press(fd, ev); // get key code
|
int key_code = get_key_press(fd, ev); // get key code
|
||||||
|
if (key_code < 1024)
|
||||||
printf("%s\n",mappings[key_code]); // print value of key code
|
printf("%s\n",mappings[key_code]); // print value of key code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user