caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Christian Schlager" <Christian.Schlager@t-online.de>
To: <caml-list@yquem.inria.fr>
Subject: keyboard mapping with lablgtk2
Date: Tue, 15 Feb 2005 21:11:53 +0100	[thread overview]
Message-ID: <002a01c5139a$99a81cf0$a83653d9@luke> (raw)

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

hi there,


i want to create a special keyboard mode for creating tables in a textview widget with lablgtk2.
To create one row the user should move with ENTER from cell to cell until the end is reached 
and then ENTER to the next row:

this is my callback-function:

let key_pressed (textview:GText.view) (ev:GdkEvent.Key.t) =
  let newch = GdkEvent.Key.string ev in
  let buffer = textview#buffer in
  let iter = buffer#end_iter in
  if (newch = "\n") then
    buffer#insert ~iter "   "
  else
    buffer#insert ~iter newch;
  true

For now it should insert empty spaces when ENTER is hit. Unfortunately it
doesn't work, it just inserts a new line.
Also, the functionality of the keyboard is limited, the backspace key for 
instance doesn't work, but i could work around that thing.
Who can tell me how to correctly test the keys?
A code snippet might be helpful, too.

Thanks for help,
Christian

[-- Attachment #2: Type: text/html, Size: 2219 bytes --]

                 reply	other threads:[~2005-02-15 20:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002a01c5139a$99a81cf0$a83653d9@luke' \
    --to=christian.schlager@t-online.de \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).