xterm f8 trouble - Xwindows

This is a discussion on xterm f8 trouble - Xwindows ; Hello, I need to set up xterm function key F8 in a very special way and haven?t found any hints yet. I want F8 to "emit" something like: Ctrl-u + 8 (press ctrl and u, release both and press 8) ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: xterm f8 trouble

  1. xterm f8 trouble

    Hello,

    I need to set up xterm function key F8 in a very special way and
    haven?t found any hints yet.

    I want F8 to "emit" something like:
    Ctrl-u + 8 (press ctrl and u, release both and press 8)

    I tried:

    xterm -title "F8" -xrm \
    'XTerm*VT100.translations: #override \n\
    F8: string(0xffe3) string("u") string("8") \n

    but this does not work (I am not a X-expert, as you can see).
    Does anybody know how to setup the function key properly?

    Thanks
    Patrick

    --
    Patrick Holland


  2. Re: xterm f8 trouble

    Patrick Holland writes:

    > Hello,
    >
    > I need to set up xterm function key F8 in a very special way and
    > haven?t found any hints yet.
    >
    > I want F8 to "emit" something like:
    > Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >
    > I tried:
    >
    > xterm -title "F8" -xrm \
    > 'XTerm*VT100.translations: #override \n\
    > F8: string(0xffe3) string("u") string("8") \n
    >
    > but this does not work (I am not a X-expert, as you can see).
    > Does anybody know how to setup the function key properly?


    I think you are on the right track but the hex value for
    control-U is 0x15.

  3. Re: xterm f8 trouble

    Dan Espen wrote:

    > Patrick Holland writes:
    >
    >> Hello,
    >>
    >> I need to set up xterm function key F8 in a very special way and
    >> haven?t found any hints yet.
    >>
    >> I want F8 to "emit" something like:
    >> Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >>
    >> I tried:
    >>
    >> xterm -title "F8" -xrm \
    >> 'XTerm*VT100.translations: #override \n\
    >> F8: string(0xffe3) string("u") string("8") \n
    >>
    >> but this does not work (I am not a X-expert, as you can see).
    >> Does anybody know how to setup the function key properly?

    >
    > I think you are on the right track but the hex value for
    > control-U is 0x15.


    Thank you Dan.
    Where can I get more info on how to calculate or look up those hex
    values?


  4. Re: xterm f8 trouble

    Patrick Holland writes:

    > Dan Espen wrote:
    >
    >> Patrick Holland writes:
    >>
    >>> Hello,
    >>>
    >>> I need to set up xterm function key F8 in a very special way and
    >>> haven?t found any hints yet.
    >>>
    >>> I want F8 to "emit" something like:
    >>> Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >>>
    >>> I tried:
    >>>
    >>> xterm -title "F8" -xrm \
    >>> 'XTerm*VT100.translations: #override \n\
    >>> F8: string(0xffe3) string("u") string("8") \n
    >>>
    >>> but this does not work (I am not a X-expert, as you can see).
    >>> Does anybody know how to setup the function key properly?

    >>
    >> I think you are on the right track but the hex value for
    >> control-U is 0x15.

    >
    > Thank you Dan.
    > Where can I get more info on how to calculate or look up those hex
    > values?


    ASCII - 0x40

    --
    Måns Rullgård
    mru@mru.ath.cx

  5. Re: xterm f8 trouble

    Måns Rullgård writes:

    > Patrick Holland writes:
    >
    >> Dan Espen wrote:
    >>
    >>> Patrick Holland writes:
    >>>
    >>>> Hello,
    >>>>
    >>>> I need to set up xterm function key F8 in a very special way and
    >>>> haven?t found any hints yet.
    >>>>
    >>>> I want F8 to "emit" something like:
    >>>> Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >>>>
    >>>> I tried:
    >>>>
    >>>> xterm -title "F8" -xrm \
    >>>> 'XTerm*VT100.translations: #override \n\
    >>>> F8: string(0xffe3) string("u") string("8") \n
    >>>>
    >>>> but this does not work (I am not a X-expert, as you can see).
    >>>> Does anybody know how to setup the function key properly?
    >>>
    >>> I think you are on the right track but the hex value for
    >>> control-U is 0x15.

    >>
    >> Thank you Dan.
    >> Where can I get more info on how to calculate or look up those hex
    >> values?

    >
    > ASCII - 0x40


    or 0x60, if you think in lowercase.

    --
    Måns Rullgård
    mru@mru.ath.cx

  6. Re: xterm f8 trouble

    Måns Rullgård wrote:

    > Måns Rullgård writes:
    >
    >> Patrick Holland writes:
    >>
    >>> Dan Espen wrote:
    >>>
    >>>> Patrick Holland writes:
    >>>>
    >>>>> Hello,
    >>>>>
    >>>>> I need to set up xterm function key F8 in a very special way and
    >>>>> haven?t found any hints yet.
    >>>>>
    >>>>> I want F8 to "emit" something like:
    >>>>> Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >>>>>
    >>>>> I tried:
    >>>>>
    >>>>> xterm -title "F8" -xrm \
    >>>>> 'XTerm*VT100.translations: #override \n\
    >>>>> F8: string(0xffe3) string("u") string("8") \n
    >>>>>
    >>>>> but this does not work (I am not a X-expert, as you can see).
    >>>>> Does anybody know how to setup the function key properly?
    >>>>
    >>>> I think you are on the right track but the hex value for
    >>>> control-U is 0x15.
    >>>
    >>> Thank you Dan.
    >>> Where can I get more info on how to calculate or look up those hex
    >>> values?

    >>
    >> ASCII - 0x40

    >
    > or 0x60, if you think in lowercase.
    >


    Which one is the right one in case of lowercase:

    F8: string(0x15) string("8") \n
    or
    F8: string(0x60) string("8") \n


    --
    Patrick Holland

  7. Re: xterm f8 trouble

    Patrick Holland writes:

    >>>> Where can I get more info on how to calculate or look up those hex
    >>>> values?
    >>>
    >>> ASCII - 0x40

    >>
    >> or 0x60, if you think in lowercase.
    >>

    >
    > Which one is the right one in case of lowercase:
    >
    > F8: string(0x15) string("8") \n
    > or
    > F8: string(0x60) string("8") \n


    OK, I should clarify. The value you want is the ASCII code of the
    character minus 0x60. The ASCII code for lower-case 'u' is 0x75.
    Subtract 0x60 from this, and you get 0x15.

    --
    Måns Rullgård
    mru@mru.ath.cx

  8. Re: xterm f8 trouble

    Patrick Holland writes:

    > Dan Espen wrote:
    >
    >> Patrick Holland writes:
    >>
    >>> Hello,
    >>>
    >>> I need to set up xterm function key F8 in a very special way and
    >>> haven?t found any hints yet.
    >>>
    >>> I want F8 to "emit" something like:
    >>> Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >>>
    >>> I tried:
    >>>
    >>> xterm -title "F8" -xrm \
    >>> 'XTerm*VT100.translations: #override \n\
    >>> F8: string(0xffe3) string("u") string("8") \n
    >>>
    >>> but this does not work (I am not a X-expert, as you can see).
    >>> Does anybody know how to setup the function key properly?

    >>
    >> I think you are on the right track but the hex value for
    >> control-U is 0x15.

    >
    > Thank you Dan.
    > Where can I get more info on how to calculate or look up those hex
    > values?


    Here is one way.

    Using bash:

    > od -x

    ctl-v ctl-u return ctl-d

    The control v tells the shell to accept the next character
    as data.

    Then hit the character then return control d to terminate reading
    from stdin. You should see this on the screen:

    home> od -x
    ^U
    0000000 0a15
    0000002

    Ignore the 0a, that's the return.

  9. F1 - F5 ok, > F5 still not ok

    Dan Espen wrote:

    >> I want F8 to "emit" something like:
    >> Ctrl-u + 8 (press ctrl and u, release both and press 8)
    >>
    >> I tried:
    >>
    >> xterm -title "F8" -xrm \
    >> 'XTerm*VT100.translations: #override \n\
    >> F8: string(0xffe3) string("u") string("8") \n
    >>
    >> but this does not work (I am not a X-expert, as you can see).
    >> Does anybody know how to setup the function key properly?

    >
    > I think you are on the right track but the hex value for
    > control-U is 0x15.


    Even though I start xterm as stated below, only F1 to F5
    do function as desired. F6 and above seem to be controlled
    by /etc/inputrc or ~/.inputrc, and inputrc does not accept
    string(0x15). Is ist possible to force xterm to ignore inputrc?

    This is how I start xterm:

    xterm**-xrm*\
    'XTerm*VT100.translations:*****#override*\n\
    F1: string(0x15) string("1") \n\
    F2: string(0x15) string("2") \n\
    F3: string(0x15) string("3") \n\
    F4: string(0x15) string("4") \n\
    F5: string(0x15) string("5") \n\
    F6: string(0x15) string("6") \n\
    F7: string(0x15) string("7") \n\
    F8: string(0x15) string("8") \n\
    F9: string(0x15) string("9") \n\
    F10: string(0x15) string("10") \n\
    F11: string(0x15) string("11") \n\
    F12: string(0x15) string("12") \n\
    -e telnet $HOST


    Patrick

    --
    Patrick Holland


  10. Re: F1 - F5 ok, > F5 still not ok

    Patrick Holland writes:

    > Even though I start xterm as stated below, only F1 to F5
    > do function as desired. F6 and above seem to be controlled
    > by /etc/inputrc or ~/.inputrc, and inputrc does not accept
    > string(0x15). Is ist possible to force xterm to ignore inputrc?


    Xterm doesn't care about inputrc (at least no version I've heard
    about). A program that do care about inputrc is bash. Anyway, you have
    to be more specific on what you are trying to do to get any more help.

    >
    > This is how I start xterm:
    >
    > xterm**-xrm*\
    > 'XTerm*VT100.translations:*****#override*\n\
    > F1: string(0x15) string("1") \n\
    > F2: string(0x15) string("2") \n\
    > F3: string(0x15) string("3") \n\
    > F4: string(0x15) string("4") \n\
    > F5: string(0x15) string("5") \n\
    > F6: string(0x15) string("6") \n\
    > F7: string(0x15) string("7") \n\
    > F8: string(0x15) string("8") \n\
    > F9: string(0x15) string("9") \n\
    > F10: string(0x15) string("10") \n\
    > F11: string(0x15) string("11") \n\
    > F12: string(0x15) string("12") \n\
    > -e telnet $HOST


    This worked perfectly here (after adding the missing ' that is).

    --
    - Mårten

    mail: msv@kth.se *** ICQ: 4356928 *** mobile: +46 (0)707390385

  11. Re: F1 - F5 ok, > F5 still not ok

    Mårten Svantesson wrote:

    > Patrick Holland writes:
    >
    >> Even though I start xterm as stated below, only F1 to F5
    >> do function as desired. F6 and above seem to be controlled
    >> by /etc/inputrc or ~/.inputrc, and inputrc does not accept
    >> string(0x15). Is ist possible to force xterm to ignore inputrc?

    >
    > Xterm doesn't care about inputrc (at least no version I've heard
    > about). A program that do care about inputrc is bash. Anyway, you
    > have to be more specific on what you are trying to do to get any
    > more help.


    I am using XFree86 4.3.99.903(184) on a Suse 9.1 (2.6.8.1 kernel). I
    tried to start a telnet session to a remote server $HOST. There I
    need function key F1 to "emit": string(0x15)*string("1")
    function key F2 to "emit": string(0x15)*string("2")
    and so on.

    If I start xterm this way:

    xterm**-xrm*\
    'XTerm*VT100.translations:*****#override*\n\
    F1:****************string(0x15)*string("1")*\n\
    F2:****************string(0x15)*string("2")*\n\
    F3:****************string(0x15)*string("3")*\n\
    F4:****************string(0x15)*string("4")*\n\
    F5:****************string(0x15)*string("5")*\n\
    F6:****************string(0x15)*string("6")*\n\
    F7:****************string(0x15)*string("7")*\n\
    F8:****************string(0x15)*string("8")*\n\
    F9:****************string(0x15)*string("9")*\n\
    F10:***************string(0x15)*string("10")*\n\
    F11:***************string(0x15)*string("11")*\n\
    F12:***************string(0x15)*string("12")*\n' \
    -e telnet $HOST

    the application I run after logging in at $HOST responds to pressing
    F1 as desired, as well as to F2 to F5 (if I start a telnet session
    out of my normal bash, they don?t). But if I press F6 - F12, nothing
    happens. Looking for the reason I started xterm without the "-e
    telnet $HOST" and placed a .inputrc in my $HOME which looks like
    this:

    "\e[17~": "f6"
    "\e[18~": "f7"
    "\e[19~": "f8"
    "\e[20~": "f9"
    "\e[21~": "f10"

    I then found that pressing F6 produces a f6, as if there would be a
    line "F6: string("f6")*\n\", but there is no such line.
    The conclusion I drew was, xterm does care about ~/.inputrc.

    This is why I have no idea why just the first 5 function keys function
    as desired, whereas those > F5 behave like beeing ~/.inputrc
    controlled.

    Patrick

    --
    Patrick Holland


  12. Re: F1 - F5 ok, > F5 still not ok

    Patrick Holland writes:

    > If I start xterm this way:
    >
    > xterm**-xrm*\
    > 'XTerm*VT100.translations:*****#override*\n\
    > F1:****************string(0x15)*string("1")*\n\
    > F2:****************string(0x15)*string("2")*\n\
    > F3:****************string(0x15)*string("3")*\n\
    > F4:****************string(0x15)*string("4")*\n\
    > F5:****************string(0x15)*string("5")*\n\
    > F6:****************string(0x15)*string("6")*\n\
    > F7:****************string(0x15)*string("7")*\n\
    > F8:****************string(0x15)*string("8")*\n\
    > F9:****************string(0x15)*string("9")*\n\
    > F10:***************string(0x15)*string("10")*\n\
    > F11:***************string(0x15)*string("11")*\n\
    > F12:***************string(0x15)*string("12")*\n' \
    > -e telnet $HOST
    >
    > the application I run after logging in at $HOST responds to pressing
    > F1 as desired, as well as to F2 to F5 (if I start a telnet session
    > out of my normal bash, they don?t). But if I press F6 - F12, nothing
    > happens. Looking for the reason I started xterm without the "-e
    > telnet $HOST" and placed a .inputrc in my $HOME which looks like
    > this:
    >
    > "\e[17~": "f6"
    > "\e[18~": "f7"
    > "\e[19~": "f8"
    > "\e[20~": "f9"
    > "\e[21~": "f10"
    >
    > I then found that pressing F6 produces a f6, as if there would be a
    > line "F6: string("f6")*\n\", but there is no such line.
    > The conclusion I drew was, xterm does care about ~/.inputrc.


    Well, as I wrote bash reads inputrc (since it's implemented with the
    help of the readline library). So what's seems to be happening is that
    bash intercepts "\e[17~" and so on and then produces "f6" et all.

    The simplest way to see what the shell recieves is pressing Control-v
    and then the key in question. Escape is shown as \[ or \{ depending on
    version.

    Unfortunately I don't have a solution to your problem since I can't
    reproduce it.


    --
    - Mårten

    mail: msv@kth.se *** ICQ: 4356928 *** mobile: +46 (0)707390385

+ Reply to Thread