This is the mail archive of the cygwin@sources.redhat.com 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]

Re: Patch submission for AltGr handling


Actually, I have no problems with having both ALT keys generate a meta.
I would rather not add to the plethora of CYGWIN options if we can
help it.

cgf

On Tue, Feb 27, 2001 at 02:25:55PM -0800, Jason Tiller wrote:
>Hello, Everyone, :)
>
>Per the instructions on http://www.cygwin.com/contrib.html, here is
>the patch and ChangeLog entry for my minor changes to allow the user
>to configure the right-side <alt> key (AltGr) to generate
>Meta-prefixed characters as opposed to high-bit characters.  This is
>accomplished by a new CYGWIN environment variable option:
>'right_alt_meta'.  With this specified, AltGr generates Meta.  The
>default case or with 'noright_alt_meta' specified is to ignore AltGr
>in the console handler.
>
>I chose to submit this here because the page indicated that small
>patches could be sent to the user list.  I would be willing to submit
>text for the FAQ and/or User Guide if either of those documents had a
>section on the CYGWIN variable.
>
>Here are the diffs:
>
>--- environ.cc.orig	Mon Jan 29 18:36:10 2001
>+++ environ.cc	Mon Feb 26 22:44:40 2001
>@@ -33,6 +33,7 @@ extern BOOL allow_smbntsec;
> extern BOOL strip_title_path;
> extern DWORD chunksize;
> BOOL reset_com = TRUE;
>+extern BOOL meta_mask;
> static BOOL envcache = TRUE;
>
> static char **lastenviron = NULL;
>@@ -451,6 +452,7 @@ struct parse_thing
>   {"ntsec", {&allow_ntsec}, justset, NULL, {{FALSE}, {TRUE}}},
>   {"smbntsec", {&allow_smbntsec}, justset, NULL, {{FALSE}, {TRUE}}},
>   {"reset_com", {&reset_com}, justset, NULL, {{FALSE}, {TRUE}}},
>+  {"right_alt_meta", {&meta_mask}, justset, NULL, {{LEFT_ALT_PRESSED}, {LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED}}},
>   {"strip_title", {&strip_title_path}, justset, NULL, {{FALSE}, {TRUE}}},
>   {"title", {&display_title}, justset, NULL, {{FALSE}, {TRUE}}},
>   {"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}},
>
>
>--- fhandler_console.cc.orig	Mon Jan 29 18:36:12 2001
>+++ fhandler_console.cc	Mon Feb 26 22:44:40 2001
>@@ -50,6 +50,11 @@ const char * get_nonascii_key (INPUT_REC
>
> static BOOL use_mouse = FALSE;
>
>+// This is a constant set by the user via CYGWIN=.  It is set to a
>+// mask which we apply against characters coming from the console to
>+// determine it they should be prefixed by META (\033).
>+int meta_mask = LEFT_ALT_PRESSED;
>+
> static tty_min NO_COPY *shared_console_info = NULL;
>
> /* Allocate and initialize the shared record for the current console.
>@@ -220,7 +225,7 @@ fhandler_console::read (void *pv, size_t
> 		 converting a CTRL-U. */
> 	      if ((unsigned char)ich > 0x7f && current_codepage == ansi_cp)
> 		OemToCharBuff (tmp + 1, tmp + 1, 1);
>-	      if (!(input_rec.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED))
>+	      if (!(input_rec.Event.KeyEvent.dwControlKeyState & meta_mask))
> 		toadd = tmp + 1;
> 	      else
> 		{
>
>
>Here is the ChangeLog:
>
>Tue Feb 27 14:22:10 2001  Jason Tiller <jdtiller@best.com>
>
>	* environ.cc: Add extern link to to keyboard meta key mask
>	global variable.
>	Add "right_alt_meta" CYGWIN environment option to 'struct
>	parse_thing known[]' array.  User sets "right_alt_meta" to use
>	the right <alt> key (AltGr) as Meta, not as a modifier.
>	* fhandler_console.cc: Add global variable 'meta_mask'.
>	(fhandler_console::read): Use new meta_mask variable to test
>	input keystrokes for Meta instead of just LEFT_ALT_PRESSED.
>
>
>Thank you for considering this patch.  I hope others can get some use
>out of it.
>
>---Jason Tiller
>jdtiller@best.com
>Sonos
>
>
>--
>Want to unsubscribe from this list?
>Check out: http://cygwin.com/ml/#unsubscribe-simple

-- 
cgf@cygnus.com                        Red Hat, Inc.
http://sources.redhat.com/            http://www.redhat.com/

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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