Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8412857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:47:00+00:00 2026-06-10T00:47:00+00:00

My app reading escape sequences from terminal in raw mode. And when it’s running

  • 0

My app reading escape sequences from terminal in raw mode. And when it’s running on xterm I got F2 like “\eOQ”. But when it’s running in linux tty terminal (Switching by Ctrl-Alt-F1) I got “\e[[[B”.
What is the correct way to determine that I got F2 independent from terminal type application running on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:47:01+00:00Added an answer on June 10, 2026 at 12:47 am

    If you’re wanting to read terminal keypresses, you likely want to look at something like libtermkey , which abstracts the general problem away for you. Internally it uses a combination of terminfo lookups, or hardcoded knowledge of the extended xterm-like model for modified keypresses, so it can understand things like Ctrl-Up, which a regular curses/etc… cannot.

    while((ret = termkey_waitkey(tk, &key)) != TERMKEY_RES_EOF) {
      termkey_strfkey(tk, buffer, sizeof buffer, &key, TERMKEY_FORMAT_VIM);
      printf("You pressed key %s\n", buffer);
    
      if(key.type == TERMKEY_TYPE_FUNCTION &&
         !key.modifiers &&
         key.code.number = 2)
        printf("Got F2\n");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my app reading from a SQLite database and display the text on UILabel, but
I've got my first impression of Spring WebFlow 2.1 from studying the reference app
Possible Duplicate: Reading dll.config (not app.config!) from a plugin module. I have two different
My Android app is reading and writing to a local SQLite DB from a
I am getting a casting error. My app is reading a text file from
I am create one app ocr reading from camera, get capture image from camera
I am designing a Windows 8 Metro reading app, and got a problem of
I'm wondering if I can write something like reading app (to turn my Zune
I`m working on an app that does reading and handling specific URIs from NFC
I'm reading everywhere the running a Silverlight app as out-of-browser allows you to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.