Find the answer to your Linux question:
Results 1 to 4 of 4
How can I send enter key to a virtual terminal ?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5

    Question Sending enter key to a virtual terminal


    How can I send enter key to a virtual terminal ?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    12,001
    Please explain more clearly what your environment is and what you are trying to accomplish. I can only read your mind somewhat fuzzily... Injecting keypresses into a remove system (virtual terminal) is possible, but not simple.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5
    I am using OpenSuse 12.1. I want to send a command to a virtual terminal and send enter key to execute the command.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    12,001
    Quote Originally Posted by janberq View Post
    I am using OpenSuse 12.1. I want to send a command to a virtual terminal and send enter key to execute the command.
    You need to open the input device of the VT and inject (using an ioctl I expect) a key code (1 or more bytes) into the input buffer. Then you need to enable the appropriate interrupt so that the VT will see the input bytes and treat them as though the keyboard had provided them. I've done this in the past on other Unix and Unix-like operating systems, but not on Linux per se, other than for an X-Windows application (different process than for a console/tty application).
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •