Getting pressed keyboard key... getch()?

is it possible to read the ascii value of the key that's pressed without having to do it trough the serial monitor?

i believe it's getch() or something but since i can't find a way to include conio.h to arduino i don't know what to do :?

anyone have some xp?

is it possible to read the ascii value of the key that's pressed

I'm pressing some keys now. Can YOU read what they are?

The ONLY means of communication between the Arduino and the PC is the serial port, and some application on the PC has to be seeing the keystrokes and talking to the Arduino, via the serial port.

I'm asking is there a way for Arduino to read the pressed key without having to send it trough serial monitor, like when you start Cpp or C console and you just press q and it writes 113.

So I'm asking is there a way to send pressed key directly to arduino.

Checkout keyboard serial example.

I'm asking is there a way for Arduino to read the pressed key without having to send it trough serial monitor

NO!

like when you start Cpp or C console and you just press q and it writes 113.

You start a cpp or c application on the machine that the keyboard is attached to. The keyboard is NOT attached to the Arduino.

rxbertx:
is it possible to read the ascii value of the key that's pressed without having to do it trough the serial monitor?

i believe it's getch() or something but since i can't find a way to include conio.h to arduino i don't know what to do :?

You can't use conio.h on an Arduino because it does not come with a console terminal.
Before you can read an ascii value from a keyboard key press you have to specify what the keyboard is connected to and where the ascii value will be displayed.

rxbertx:
So I'm asking is there a way to send pressed key directly to arduino.

I'm asking is there a way for Arduino to read the pressed key without having to send it trough serial monitor, like when you start Cpp or C console and you just press q and it writes 113.

Depends on the type of keyboard and where you connect it.
You have to connect the keyboard to the Arduino and NOT THE PC to read the keys from the Arduino and not the PC.

Yes, there are projects that use a PC keyboard with PS/2 connector connected to an Arduino UNO. With a suitable sketch you then can read the keyboard 'scancodes' from the keyboard.

This is the circuit schematics how to connect the keyboards PS/2 connector to an Arduino UNO.

Here is the full instructables instructions including sketch code.

Using the Minicom terminal pgm on Linux with software flow control set sends characters to this sketch without hitting [ENTER], there's still the one second timeout though.

const int ledPin = 9; // the pin that the LED is attached to

void setup()
{
  // initialize the serial communication:
  Serial.begin(9600);
  // initialize the ledPin as an output:
  pinMode(ledPin, OUTPUT);
}

void loop() {
  byte brightness;

  // check if data has been sent from the computer:
  if (Serial.available()) {
    // read the most recent byte (which will be from 0 to 255):
    brightness = Serial.parseInt();
     //set the brightness of the LED:
    analogWrite(ledPin, brightness);
    Serial.println(brightness);
  }
}

Works with this too, immediately, no timeout:

int incomingByte = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {

        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();

                // say what you got:
                Serial.print("I received: ");
                Serial.println(incomingByte, DEC);
        }
}
Welcome to minicom 2.7

OPTIONS: I18n 
Compiled on Jan  1 2014, 17:13:19.
Port /dev/ttyUSB0, 12:34:48

Press CTRL-A Z for help on special keys

I received: 106
I received: 108
I received: 100
I received: 109
I received: 97
I received: 98
I received: 99
I received: 49
I received: 50
I received: 51