Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: intercept ctrl C

  1. #1
    Junior Member
    Join Date
    Dec 2020
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question intercept ctrl C

    Hi, Friends
    I did a small java terminal app run in console. It send key input to serial, and display string received from serial port.
    then I type ctrl+C, I don't want my terminal app exit. in stead, I want send ctrl+C to serial. how to do it? please give me suggestions. I appreciate it.

    thanks
    Xainwu

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: intercept ctrl C

    I think you need a window with focus to get keyboard input. See this:
    https://stackoverflow.com/questions/...ress-detection
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Dec 2020
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: intercept ctrl C

    Quote Originally Posted by Norm View Post
    I think you need a window with focus to get keyboard input. See this:
    https://stackoverflow.com/questions/...ress-detection
    thank you

Similar Threads

  1. Intercept instance of the program already running
    By ZioCrick in forum Object Oriented Programming
    Replies: 4
    Last Post: October 30th, 2019, 12:54 PM
  2. Replies: 3
    Last Post: June 9th, 2014, 01:16 AM
  3. Trying to use CTRL-D to terminate the program (sentinel value)
    By loui345 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 2nd, 2014, 08:13 PM
  4. [SOLVED] Problem controlling a ctrl + c signal by console
    By Thabby in forum What's Wrong With My Code?
    Replies: 8
    Last Post: December 5th, 2012, 03:38 PM
  5. Turn off/ignore win, alt, and ctrl keys
    By Melawe in forum What's Wrong With My Code?
    Replies: 18
    Last Post: August 31st, 2012, 05:38 PM

Tags for this Thread