"If you only have lemons, make lemonade."

Hello,

Thanks for your input.

Input Method is part of NLS, and judging from the documentation,

   http://www.unet.univie.ac.at/aix/aixprggd/genprogc/greek.htm

IM is part of X.

I'm just wondering what Linux would be like without running an X server.

The Linux console 'keymaps' looks like a Single-Byte Input Method (SIM).

Other input methods (i.e. JIM, ZIM, KIM, THIM...) look significantly more
complex.

A SIM scanner should be able to handle most European writing systems, Eastern,
Western Latin, Greek, Cyrillic, by just substituting the keymap, but the Greek
IM only does Latin and (modern) Greek.

Did you say there was a SIM keymap that does polytonic Greek?

My cygwin has nothing even coming close to NLS and locales, so I'm going to try
to reverse engineer the SIM and see if I can make it work in a DOS console.

(I wonder how XFree86 on cygwin responds to NLS.)

This is all just idle curiosity.

Linux seems to work remarkably well, and X is very good. I'm impressed.

At first glance, I didn't understand the literature, but things are becoming
clear now.

Thanks again.

Elvis

PS

The SIM keymap is only slightly more complex than an array lookup.
:-)

<attachment>

-- naive keymaps

-- ordinary symbols representing arbitrary constants

Shift = 256
Alt   = 512
Ctrl  = 1024

-- ordinary symbols representing numeric keycodes

alpha = 30                  --'a'
epsilon = 18                --'e'
eta = 35                    --'h'
omega = 47                  --'v'
oxia = 53                   --'/'
varia = 43                  --'\\'
perispomeni = Shift+41      --'~'
ennea = 10                  --'9' don't get confused!
psili = Shift+ennea         --')'
mhden = 11                  --'0'
dasia = Shift+mhden         --'('
ypogegrammeni = Shift+varia --'|'

-- more constants. symbols representing characters

small_omega =  0x03c9
small_omega_varia = 0x1f7c
small_omega_varia_ypogegrammeni = 0x1ff2
small_omega_oxia  = 0x1f7d
small_omega_oxia_ypogegrammeni = 0x1ff4
small_omega_perispomeni = 0x1ff6
small_omega_perispomeni_ypogegrammeni = 0x1ff7

small_omega_psili = 0x1f60
small_omega_psili_varia = 0x1f62
small_omega_psili_varia_ypogegrammeni = 0x1fa2
small_omega_psili_oxia  = 0x1f64
small_omega_psili_oxia_ypogegrammeni  = 0x1fa4
small_omega_psili_perispomeni = 0x1f66
small_omega_psili_perispomeni_ypogegrammeni = 0x1fa6
small_omega_psili_ypogegrammeni = 0x1fa0

-- This statement defines all the keysyms of keycode 10,
-- i.e. ennea, Shift+ennea, Alt+ennea, Alt+Shift+ennea,
-- Ctrl+ennea, Ctrl+Shift+ennea, Ctrl+Alt+ennea,
-- Ctrl+Alt+Shift+ennea.
-- All unnamed keysyms get default values

keycode ennea   = '9' '('  --ascii character events

--

keycode mhden   = '0' ')'

keycode alpha   = small_alpha   capital_alpha
keycode epsilon = small_epsilon capital_epsilon
keycode eta     = small_eta     capital_eta
keycode iota    = small_iota    capital_iota
keycode omicron = small_omicron capital_omicron
keycode ypsilon = small_ypsilon capital_ypsilon

-- a keysym appears in two contexts, as a 'keycode'
-- and as a member of a 'compose' sequence.

-- state 0 keysym definition for omega

keycode omega   = small_omega   capital_omega

-- state n keysym definitions
-- oxia, omega = small_omega_oxia
-- omega, oxia = small_omega_oxia

compose omega oxia  = small_omega_oxia
compose oxia  omega = small_omega_oxia

--

compose varia omega = small_omega_varia
compose psili omega = small_omega_psili

compose Shift+10 53   47    = 0x1F60
compose psili    oxia omega = small_omega_psili_oxia

compose psili oxia ypogegrammeni omega = small_omega_psili_oxia_ypogegrammeni;
-- a pretty long line

compose psili varia omega = small_omega_psili_varia
compose psili varia ypogegrammeni omega =
small_omega_psili_varia_ypogegrammeni; -- another long line

=========================================
      &#969;               &#937;
->[0]--->[[&#969;]]  ->[0]--->[[&#937;]]

      &#969;        /
->[0]--->[960]--->[[&#8061;]]

      /        &#969;
->[0]--->[961]--->[[&#8061;]]

      \        &#969;
->[0]--->[962]--->[[&#8060;]]

      (        &#969;
->[0]--->[963]--->[[&#8033;]]

      (        /        &#969;
->[0]--->[963]--->[964]--->[[&#8036;]]

      (        /        |        &#969;
->[0]--->[963]--->[964]--->[965]--->[[&#8101;]]

      (        \        &#969;
->[0]--->[963]--->[966]--->[[&#8035;]]

      (        \        |        &#969;
->[0]--->[963]--->[966]--->[967]--->[[&#8099;]]
=========================================

--- Elvis Presley <[EMAIL PROTECTED]> wrote:
> Naïve Keymap
> 
> Greetings,
> 
> The 'keymaps' structure seems to boil down to something like this:
> 
> =======================================================
> #include <stdio.h>
> 
> const int map = 3;
> enum language {english, greek, russian};
> 
> const int keysym = 8;
> enum modifier {normal=0x0, shift=0x1, alt=0x2 , ctrl=0x4};
> 
> const int keycode = 120;
> // keys are not enumerated.
> 
> int keymap[map][keycode][keysym]; //<---- KEYMAP
> 
> int main(int argc, char *argv[])
> {
>   keymap[english][30][normal]     = 'a';
>   keymap[english][30][shift]      = 'A';
>   keymap[english][30][alt]        = 0x1b61;  // "\eA"
>   keymap[english][30][alt+shift]  = '?';
>   keymap[english][30][ctrl]       = 0x01;    // SOH
>   keymap[english][30][ctrl+shift] = '?';
>   keymap[english][30][ctrl+alt]   = '?';
>   keymap[english][30][ctrl+alt+shift] = '?';
> 
>   keymap[english][47][normal] = 'v';
>   keymap[english][47][shift]  = 'V';
> 
>   keymap[greek][30][normal] = 0x03b1; //&#945;
>   keymap[greek][30][shift]  = 0x0391; //&#913;
> 
>   keymap[greek][47][normal] = '&#969;';
>   keymap[greek][47][shift]  = '&#937;';
> 
>   printf("%C\n", keymap[greek][47][normal]);
>   return 0;
> }
> =======================================================



                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to