From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 61B70BC8E for ; Tue, 15 Feb 2005 21:09:35 +0100 (CET) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1FK9ZXG007293 for ; Tue, 15 Feb 2005 21:09:35 +0100 Received: from fwd00.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1D190o-0004bK-01; Tue, 15 Feb 2005 21:09:34 +0100 Received: from luke (E29puoZ-Qe8w37R1kSK5+H2CwHolvFZCEr5Ii1LnGXkDwXQ9-y6vUs@[217.83.54.168]) by fwd00.sul.t-online.com with smtp id 1D190d-19VXX60; Tue, 15 Feb 2005 21:09:23 +0100 Message-ID: <002a01c5139a$99a81cf0$a83653d9@luke> From: "Christian Schlager" To: Subject: keyboard mapping with lablgtk2 Date: Tue, 15 Feb 2005 21:11:53 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0027_01C513A2.F8EFEC30" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-ID: E29puoZ-Qe8w37R1kSK5+H2CwHolvFZCEr5Ii1LnGXkDwXQ9-y6vUs X-TOI-MSGID: 552ddd2f-a53a-40b9-8c00-f51ec5c83c7e X-Miltered: at nez-perce with ID 421256FF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lablgtk:01 widget:01 lablgtk:01 buffer:01 buffer:01 iter:01 iter:01 widget:01 spaces:01 spaces:01 string:03 string:03 arial:96 arial:96 let:03 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=HTML_50_60,HTML_MESSAGE autolearn=disabled version=3.0.2 X-Spam-Level: This is a multi-part message in MIME format. ------=_NextPart_000_0027_01C513A2.F8EFEC30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=20 and then ENTER to the next row: this is my callback-function: let key_pressed (textview:GText.view) (ev:GdkEvent.Key.t) =3D let newch =3D GdkEvent.Key.string ev in let buffer =3D textview#buffer in let iter =3D buffer#end_iter in if (newch =3D "\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=20 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 ------=_NextPart_000_0027_01C513A2.F8EFEC30 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hi there,
 
 
i want to create a special keyboard = mode for=20 creating tables in a textview widget with lablgtk2.
To create one row the user should move = with ENTER=20 from cell to cell until the end is = reached=20
and then ENTER to the next = row:
 
this is my = callback-function:
 
let key_pressed (textview:GText.view)=20 (ev:GdkEvent.Key.t) =3D
  let newch =3D GdkEvent.Key.string ev = in
 =20 let buffer =3D textview#buffer in
  let iter =3D buffer#end_iter = in
  if (newch =3D "\n") then
    = buffer#insert ~iter=20 "   "
  else
    buffer#insert ~iter = newch;
  true
 
For now it should insert empty spaces = when=20 ENTER is hit. Unfortunately it
doesn't work, it just inserts a new=20 line.
Also, the functionality of the keyboard = is limited,=20 the backspace key for
instance doesn't work, but i could work = around that=20 thing.
Who can tell me how to correctly test = the=20 keys?
A code snippet might be helpful, = too.
 
Thanks for help,
Christian
------=_NextPart_000_0027_01C513A2.F8EFEC30--