Detecting CTRL+C keyboard combo and sending over serial

Just a quick question-- Is there any way to get Processing to detect that you've hit "CTRL+C" in the keyboard and then send it out over serial? I'm trying to do this while communicating to an MSP430 but it doesn't seem to be working. if (typedCharacterString.indexOf("ctrl")==0) { port.write(0x03); port.write(0x10); } ?? Thanks for any suggestions. anj

Answers

  • Try out this code and see the corresponding key codes:

    void keyPressed() {
      println((int)key, keyCode);
    }
    

    Apparently, CTRL+C is 3 for variable key... :-?

  • Thanks. I didn't get to try this out, but next time I dust off the MSP430 I'll try it.

Sign In or Register to comment.