mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] scheme functions for keyboard input


Chronological Thread 
  • From: Miguel de Benito Delgado <address@hidden>
  • To: address@hidden
  • Cc: "address@hidden" <address@hidden>
  • Subject: Re: [TeXmacs] scheme functions for keyboard input
  • Date: Thu, 30 Jan 2014 15:29:15 +0100

Hi,

On Thu, Jan 30, 2014 at 8:08 AM, Scott Michael Sullivan <address@hidden> wrote:
Is there a way in scheme to read input from the keyboard, while not adding anything to the texmacs buffer? I'm trying to write functions which can redefine keyboard maps on the fly, and I require this sort of functionality.

Keyboard events are captured by c++ code (especifically by QTMWidget if you are using the Qt port, then sent to editor_rep::handle_keypress()) and redirected to the scheme handlers "keyboard-press". You can search in the scheme code for examples of how you may use contextual overloading to handle keypresses only when the editor is in a particular state or "mode" (e.g. while in "search mode" keypresses are handled differently: they produce no output in the editor but instead are interpreted as part of the search string)

However, if you want to set keyboard maps then you may skip the low level stuff and use kbd-map and all the related infrastructure. Just look for the definition of kbd-map and around it you'll find lots of related interesting stuff.

Best,
--
Miguel de  Benito.



Archive powered by MHonArc 2.6.19.

Top of page