This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: PATCH: Readline for MinGW


   Date: Sun, 12 Jun 2005 11:42:46 +0300
   From: Eli Zaretskii <eliz@gnu.org>

   >    + #ifdef __MINGW32__
   >    +    /* Under Windows, when an extend key (like an arrow key) is
   >    +       pressed, getch() will return 0xE0 followed by a code for the
   >    +       extended key.  We use macros to transform those into the normal
   >    +       UNIX sequences for these keys.  */
   >    + 
   >    +    /* Up arrow.  */
   >    +    rl_macro_bind ("\340H", "\033[A", map);
   >    +    /* Left arrow.  */
   >    +    rl_macro_bind ("\340K", "\033[D", map);
   >    +    /* Right arrow.  */
   >    +    rl_macro_bind ("\340M", "\033[C", map);
   >    +    /* Down arrow.  */
   >    +    rl_macro_bind ("\340P", "\033[B", map);
   >    + #endif
   > 
   > It has "\34" and "\033" on the same line so I get confused whether
   > "\34" is octal or not...

   That's not "\34", that's "\340".  Which I guess explains the other
   confusion:

   > Also, I don't see any trace of the 0xE0 you mention in the comment.

   340 in octal is E0 in hex.  I.e., the up arrow, for example, produces
   two characters: 0xE0 followed by H.

Duh!  Thanks Eli.

Mark


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