× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

TN5250 is designed to have general routines to handle the basic functions
of the emulator, while at the same time allowing different "terminals" and
"streams" to be attached to this functionality.

Right now, we have these terminals:  cursesterm, slangterm, winterm and
gtkterminal.  Each of these handles the keyboard differently.   They need
a "generalized" way to tell the general-purpose 5250 functions which key
was pressed.  That's what the codes you're looking at in terminal.h are
for.

What you actually want to change is in the file winterm.c which is in the
win32 subdirectory.   There are actually 3 different tables here, one for
"character messages" one for "key down" events and one for "key up"
events.  Anything involving an alphabetic letter should be done in the
"character messages" section so it works on international keyboards.  In
your case (shift+arrow key) it should probably be done as a "key down"
event.

Searching for the string "keydown2msg" gets you in the right area.   Then
add some lines like:

  { VK_SHIFT    VK_LEFT,         K_PREVWORD  , 0, 1 },
  { VK_SHIFT    VK_RIGHT,        K_NEXTWORD  , 0, 1 },

And this should map the Windows Shift+LEFT to the 5250 PREVWORD function,
and Windows Shift+RIGHT to the 5250 NEXTWORD function.

You'll have to put this earlier in the table than the other VK_LEFT
and VK_RIGHT functions, since otherwise it'll use those mappings instead.

You may have to play with the ctx & ext pieces of the table if it doesnt
work the first time...  they have something to do with determining the
right vs. left keys, function keys vs. keypad, etc...   I always have to
experiment to get what I want :)


On Wed, 29 May 2002, Buck Calabro wrote:

> I'm not a PC guy of any sort (win* or *nix) so my attempts to decipher the
> code that handles the keyboard has been futile.  I use the Windows version
> of TN5250.  I was hoping to be able to map my keyboard in a configuration
> file, but just trying to figure out what key is where has me beat.
>
> I'm looking at terminal.h and I see a list of #define's like:
> #define K_SYSREQ      0401    /* curses KEY_BREAK */
> #define K_CLEAR               0515    /* curses KEY_CLEAR */
> #define K_REFRESH     0564    /* curses KEY_REFRESH */
> #define K_FIELDEXIT   0517    /* curses KEY_EOL (clear to EOL) */
>
> Where can I find out where curses thinks these keys are?
>
> What I really want is the functionality that allows me to jump from 'word'
> to 'word', which looks like curses KEY_SRIGHT but shift+arrow doesn't seem
> to do it for me.  I searched the web but found nothing but manpages about
> the output from getch() and friends.
>
> Where can I go to find out what physical key equates to the various curses
> key definitions?
>   --buck



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.