Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ISO VT320 emulator with key-bindings for Oracle Forms

Re: ISO VT320 emulator with key-bindings for Oracle Forms

From: Frank da Cruz <fdc_at_watsun.cc.columbia.edu>
Date: 11 Jun 1999 14:32:27 GMT
Message-ID: <7jr6lr$4f1$1@newsmaster.cc.columbia.edu>


In article <7jr2s5$4sc_at_web.nmti.com>,
Peter da Silva <peter_at_baileynm.com> wrote:
: In article <7johsh$egs$1_at_newsmaster.cc.columbia.edu>,
: Frank da Cruz <fdc_at_watsun.cc.columbia.edu> wrote:
: >: >And that in any case, this does not solve the original problem:
: >: >
: >: > How do I map Shift-Alt-F7 to such-and-such a function?
: >: >
: >: >The answer will still be: "you can't, because the software has no way of
: >: >knowing that you pressed Shift-Alt-F7".
: >: >
: >: With a keyboard mapping file that maps escape sequences to symbols that
: >: the user's interested in.
:
: >If xmodmap recognizes your keyboard and can see Shift-Alt-F7 as distinct
: >from other key combinations, then yes, but only for xterm. A separate
: >solution is required for the console. Remote (non-X) sessions haven't a
: >prayer.
:
: Where did I say anything about xmodmap? I'm simply saying that a properly
: written terminal emulator can run on UNIX and provide the functionality
: required. That there isn't one that you know of is because there isn't a
: great need for one, not that one's hard to write.
:

Sorry, didn't mean to infer statements you didn't make -- after all, we "da"'s have to stick together :-)

But again: in general, there is no API in UNIX to get the keycode of a keyboard event.

PC operating systems like DOS and Windows let you do this at various levels: per-key up/down events ("make/break codes") at the lowest level, keycodes representing a composite event (such as "Shift-Alt-F7 was pressed") at the next level, and ASCII characters at the top level. In general, UNIX only gives you the top level.

If you have an X application, you can get keycodes. If your non-X application is running in an X window, then it will get a stream of ASCII which results from the X keymap. A stream of ASCII characters is inherently ambiguous. If you get <ESC>OD, is it because the user pressed the Left Arrow key, or because s/he pressed the Esc key, then the O key, then the D key?

If your application is running on the raw console, it *could* get keycodes or raw key events but there is, in general, no API for this. Specific UNIX varieties and versions *might* have such an API, but it will not be portable, and it can't be used when the application is coming in a serial port, or on a Telnet or Rlogin connection, or for that matter, in X.

Case in point -- Linux has obscure ways to put the console keyboard into "raw" or "half-cooked" mode, but these are rarely used -- not only because they are obscure, but because if your application messes up (e.g. crashes) without putting the keyboard back the way it found it upon exit, you'll need to pull the plug on your PC before you can use it again.

Received on Fri Jun 11 1999 - 09:32:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US