ncurses Strange Keys

This is a discussion on ncurses Strange Keys within the C Programming forums, part of the General Programming Boards category; In my ncurses text editor, when the user presses Backspace, the program gets the Delete key, and if the user ...

  1. #1
    MTK
    MTK is offline
    Registered User
    Join Date
    Aug 2009
    Posts
    198

    ncurses Strange Keys

    In my ncurses text editor, when the user presses Backspace, the program gets the Delete key, and if the user presses Delete, it gets the character 'J'. Does anyone have an idea why?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Use the internets, Luke!

    Curses Problem in Detecting Backspace
    http://www.faqs.org/docs/Linux-mini/...aceDelete.html

    Something like that perhaps?


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    MTK
    MTK is offline
    Registered User
    Join Date
    Aug 2009
    Posts
    198
    stty says that backspace is mapped to 0x08
    xev shows that backspace is 0x08 and deleter is 0x7f

    That seems right so I still can't find the problem.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,488
    Post a small ncurses program to print out BS/Del input.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simulate Keys with a Keyboard Hook
    By guitarist809 in forum Windows Programming
    Replies: 3
    Last Post: 11-14-2008, 07:14 PM
  2. blocking or passing keys with global hook
    By pmouse in forum Windows Programming
    Replies: 4
    Last Post: 08-29-2007, 02:54 PM
  3. Function keys and strange results
    By divineleft in forum Linux Programming
    Replies: 3
    Last Post: 11-12-2006, 05:39 AM
  4. Strange results using dnsapi and windns
    By Niara in forum Networking/Device Communication
    Replies: 3
    Last Post: 08-13-2005, 10:21 AM
  5. Strange Direct Input Behaviour
    By Diamonds in forum Windows Programming
    Replies: 2
    Last Post: 06-23-2003, 04:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21