user1685: My idea seems easy: 
I connect a button with arduino, then write some code and upload it to arduino. Then I open the notepad(or any other editor) on my computer. When I press the button, there will be a character "A" displayed in the notepad.
I have tried with my Arduino uno, and use Serial.write/print function to send an A to serial port 9600, but it seems the character A only shows in the serial monitor GUI.
My question is:

Is "Arduino uno" is OK to implement this?
If not, what other board should I use?
Is Serial.write/print the correct function?
Or shall I use the Keyboard.??? function?
Do I have to write an application which runs on the computer and listens the serial port, and emit a real key event? (that's sad)


user313: Your example describes collecting text - does that meet your goal or do you need to generate any kind of key-event? If you don't need to generate system events, any terminal emulator (not just the Arduino IDE) should be able listen to that same port and to log whatever it receives to a file.

user304: There is a micro designed more specifically for keyboard emulation, I haven't done any experimenting with it (yet), but it's very popular in the flight simulator world where these micro's are rigged up with buttons and switches and rotary encoders to simulate a cockpit. These inputs are converted to keyboard inputs (as far as I can see). 
There are some general projects here: https://www.pjrc.com/teensy/projects.html
Some more keyboard specific stuff: https://www.pjrc.com/teensy/usb_keyboard.html
More info on the teensy in the arduino environment: https://www.pjrc.com/teensy/teensyduino.html
More specifically about what you're looking for, this could be quite useful: https://www.pjrc.com/teensy/td_keyboard.html
I'm not steering you away from Arduino, it's just something else to look into

user11: The Uno is not the best board for this. You may be able to get somewhere with the Virtual USB project but there are a couple of boards that are better suited for this.
Those are the Arduino Leonardo, Micro, and Due. In those, you can use the Keyboard Library just like you are using the Serial library now. This page has an example very similar to your project:
void setup() {
  // make pin 2 an input and turn on the 
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(2, INPUT_PULLUP);
  Keyboard.begin();
}

void loop() {
  //if the button is pressed
  if(digitalRead(2)==LOW){
    //Send the message
    Keyboard.print("Hello!");
  }
}


1685: <p>My idea seems easy: </p>

<p>I connect a button with arduino, then write some code and upload it to arduino. Then I open the notepad(or any other editor) on my computer. When I press the button, there will be a character "A" displayed in the notepad.</p>

<p>I have tried with my Arduino uno, and use <code>Serial.write/print</code> function to send an <code>A</code> to serial port <code>9600</code>, but it seems the character <code>A</code> only shows in the serial monitor GUI.</p>

<p>My question is:</p>

<ol>
<li>Is "Arduino uno" is OK to implement this?</li>
<li>If not, what other board should I use?</li>
<li>Is <code>Serial.write/print</code> the correct function?</li>
<li>Or shall I use the <code>Keyboard.???</code> function?</li>
<li>Do I have to write an application which runs on the computer and listens the serial port, and emit a real key event? (that's sad)</li>
</ol>
 313: <p>Your example describes collecting text - does that meet your goal or do you need to generate any kind of key-event? If you don't need to generate system events, any terminal emulator (not just the Arduino IDE) should be able listen to that same port and to log whatever it receives to a file.</p>
 304: <p>There is a micro designed more specifically for keyboard emulation, I haven't done any experimenting with it (yet), but it's very popular in the flight simulator world where these micro's are rigged up with buttons and switches and rotary encoders to simulate a cockpit. These inputs are converted to keyboard inputs (as far as I can see). </p>

<p>There are some general projects here: <a href="https://www.pjrc.com/teensy/projects.html" rel="nofollow">https://www.pjrc.com/teensy/projects.html</a></p>

<p>Some more keyboard specific stuff: <a href="https://www.pjrc.com/teensy/usb_keyboard.html" rel="nofollow">https://www.pjrc.com/teensy/usb_keyboard.html</a></p>

<p>More info on the teensy in the arduino environment: <a href="https://www.pjrc.com/teensy/teensyduino.html" rel="nofollow">https://www.pjrc.com/teensy/teensyduino.html</a></p>

<p>More specifically about what you're looking for, this could be quite useful: <a href="https://www.pjrc.com/teensy/td_keyboard.html" rel="nofollow">https://www.pjrc.com/teensy/td_keyboard.html</a></p>

<p>I'm not steering you away from Arduino, it's just something else to look into</p>
 11: <p>The Uno is not the best board for this. You may be able to get somewhere with the <a href="http://practicalarduino.com/projects/virtual-usb-keyboard">Virtual USB</a> project but there are a couple of boards that are better suited for this.</p>

<p>Those are the Arduino Leonardo, Micro, and Due. In those, you can use the <a href="http://arduino.cc/en/Reference/MouseKeyboard">Keyboard Library</a> just like you are using the Serial library now. <a href="http://arduino.cc/en/Reference/KeyboardPrint">This page</a> has an example very similar to your project:</p>

<pre><code>void setup() {
  // make pin 2 an input and turn on the 
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(2, INPUT_PULLUP);
  Keyboard.begin();
}

void loop() {
  //if the button is pressed
  if(digitalRead(2)==LOW){
    //Send the message
    Keyboard.print("Hello!");
  }
}
</code></pre>
