This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Passing through the keyboard layout settings from Win32 to cygwin


On Mon, 21 Jun 2004, Ariel Burbaickij wrote:

> Hello dear mailing list participants,
>
> this is basically re-post of my e-mail
> send a while ago. Noone answered the original
> question, so let us see how lucky I am this this
> time.
>
> is it somehow possible to pass through the actual
> keyboard layout settings of host machine to cygwin console?
> Here the explanation: Occasionally I need to type
> in German or Russian or some other languages, so
> I simply switch the kyeboard layout in Win2000. Is some hook
> defined or can be defined that adjusts also the
> locale settings of cygwin as soon as it happens?
>
> With Best Regards
> Ariel Burbaickij

Ariel,

There's no code in Cygwin that dynamically detects a switch in keyboard
settings.  Cygwin does inherit the keyboard settings from Windows, but
doesn't process them in any way.  I can think of a few ways to do what you
want, but all of them involve some amount of coding, and none of them do
this dynamically.  The simplest idea is to write a small program (e.g.,
"compute_locale") that queries the keyboard state and outputs the correct
locale settings, and then "eval" its output from your shell's rc file.
That way, whenever you start a new shell, it, and any programs invoked by
it, will have the correct locale settings for the current keyboard mode.

If you find a way (on MSDN?) to add a hook to the Windows keyboard layout
switch utility, have that hook send a special unused signal to (all?)
Cygwin programs, and add code to cygwin1.dll to set the locale correctly
when handling that signal.  You can probably reuse the locale computation
code from "compute_locale" above.

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]