Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Changing the console key mapping
Ref. No. QNX.000000162
Category(ies) Utilities
Issue Is there a way to change the leading code from $FF for function keys and arrows, etc... to some other sequence)?
(Or even just change the key sequence)?


Solution If you switch to ANSI mode temporarily, you can try something like this:

    #! /bin/sh

    OLDTERM="$TERM"

    if [ "$TERM" = qnx ]
        then
            for ARG in $(stty -g)
                do
                    if [ "protocol=0" = "$ARG" ]
                        then
                            TERM=qansi
                            stty protocol=1 load
                            break
                        fi
                done
            if [ "$TERM" = qnx ]
                then
                    echo "Unable to switch to ANSI" >&2
                    exit 1
                fi
        fi

    run_the_application

    if [ "$OLDTERM" != "$TERM" ]
        then
            TERM=qnx
            stty protocol=0 load
        fi