Logo Search packages:      
Sourcecode: tamil-gtk2im version File versions  Download package

tamil99-tsc.c

/*
Copyright (c) 2003, Dinesh Nadarajah
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, 
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, 
      this list of conditions and the following disclaimer in the documentation and/or 
      other materials provided with the distribution.
    * Neither the name of the author nor the names of its contributors 
      may be used to endorse or promote products derived from this software 
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "taxim.h"

static const GtkIMContextInfo ta_tsc_xim_info = { 
   "tamil99-tsc",     /* ID */
   N_("Tamil99 (TSCII)"),   /* Human readable name */
   "gtk+",            /* Translation domain */
   "",                /* Dir for bindtextdomain (not strictly needed for "gtk+") */
   ""                   /* Languages for which this module is the default */
};

gint language = ENGLISH;
gint last_sent_keysym = 0;
guint32 last_sent_unicode = 0;

static const GtkIMContextInfo *info_list[] = {
  &ta_tsc_xim_info
};

GType type_ta_tsc = 0;

//-----------------------------------------------------------
void im_module_init (GTypeModule *type_module)
{
  gtk_im_context_ta_tsc_xim_register_type (type_module);
}

//-----------------------------------------------------------
void im_module_exit (void)
{
  gtk_im_context_ta_tsc_xim_shutdown ();
}

//-----------------------------------------------------------
void im_module_list (const GtkIMContextInfo ***contexts, int *n_contexts)
{
  *contexts = info_list;
  *n_contexts = G_N_ELEMENTS (info_list);
}

//-----------------------------------------------------------
GtkIMContext *im_module_create (const gchar *context_id)
{
  if (strcmp (context_id, "tamil99-tsc") == 0)
     return GTK_IM_CONTEXT(g_object_new (type_ta_tsc, NULL));
  else
     return NULL;
}

//-----------------------------------------------------------
void gtk_im_context_ta_tsc_xim_shutdown (void)
{
}

//------------------------------------------------------------
void gtk_im_context_ta_tsc_xim_register_type (GTypeModule *type_module)
{
  static const GTypeInfo im_context_ta_tsc_xim_info =
  {
    sizeof (GtkIMContextClass),
    (GBaseInitFunc) NULL,
    (GBaseFinalizeFunc) NULL,
    (GClassInitFunc) gtk_im_context_ta_tsc_xim_class_init,
    NULL,           /* class_finalize */    
    NULL,           /* class_data */
    sizeof (GtkIMContext),
    0,
    (GtkObjectInitFunc) gtk_im_context_ta_tsc_xim_init,
  };

  type_ta_tsc = 
    g_type_module_register_type (type_module,
                         GTK_TYPE_IM_CONTEXT,
                         "GtkIMContextTA99TSC",
                         &im_context_ta_tsc_xim_info, 0);
}

//------------------------------------------------------------
void gtk_im_context_ta_tsc_xim_class_init (GtkIMContextClass *class)
{
  GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class);

  //GObjectClass *gobject_class = G_OBJECT_CLASS (class);

  //parent_class = g_type_class_peek_parent (class);

  //im_context_class->set_client_window = gtk_im_context_xim_set_client_window;
  im_context_class->filter_keypress = gtk_im_context_ta_tsc_xim_filter_keypress;
  //im_context_class->reset = gtk_im_context_xim_reset;
  //im_context_class->get_preedit_string = gtk_im_context_xim_get_preedit_string;
  //im_context_class->focus_in = gtk_im_context_xim_focus_in;
  //im_context_class->focus_out = gtk_im_context_xim_focus_out;
  //im_context_class->set_cursor_location = gtk_im_context_xim_set_cursor_location;
  //im_context_class->set_use_preedit = gtk_im_context_xim_set_use_preedit;
  //gobject_class->finalize = gtk_im_context_xim_finalize;
}

//------------------------------------------------------------
void gtk_im_context_ta_tsc_xim_init (GtkIMContext *im_context_xim)
{
  //im_context_xim->use_preedit = FALSE;
  gtk_im_context_set_use_preedit(im_context_xim, FALSE);
}

//------------------------------------------------------------
gboolean gtk_im_context_ta_tsc_xim_filter_keypress (GtkIMContext *context,
                                            GdkEventKey  *event)
{
   if (event->type == GDK_KEY_PRESS) {

      if (event->keyval == GDK_BackSpace)
         last_sent_unicode = 0;         

      if ((event->state & GDK_SHIFT_MASK) &&
         (event->keyval == GDK_Shift_L || event->keyval == GDK_Shift_R)) {
             // switch language codes
             language = !language;
             return TRUE;
      }

      else if (language == TAMIL &&
               event->keyval >= GDK_space && event->keyval <= GDK_asciitilde) {
                  return process_tscii_tamil99(context, event);
      }

      else {
             guint32 u;
           guchar utf8[16];

           u = gdk_keyval_to_unicode(event->keyval);
           if (u == 0) {
             return FALSE;
           }
           utf8[g_unichar_to_utf8(u, utf8)] = '\0';
             g_signal_emit_by_name(context, "commit", utf8);
             last_sent_keysym = event->keyval;
             last_sent_unicode = u;
             return TRUE;
      }

   }
   
   return FALSE;
}

//----------------------------------------------------------------
void send_1_unicode_value(GtkIMContext *context, guint32 u1) {

   guchar utf8[16]; 
   
   utf8[g_unichar_to_utf8(u1, utf8)] = '\0';

   g_signal_emit_by_name(context, "commit", utf8);        
}

//----------------------------------------------------------------
void send_2_unicode_value(GtkIMContext *context, guint32 u1, guint32 u2) {

   guchar utf8[16]; 

   utf8[g_unichar_to_utf8(u1, utf8)] = '\0';
   g_signal_emit_by_name(context, "commit", utf8);  
   utf8[g_unichar_to_utf8(u2, utf8)] = '\0';
   g_signal_emit_by_name(context, "commit", utf8);        
}

//----------------------------------------------------------------
void send_3_unicode_value(GtkIMContext *context, guint32 u1, guint32 u2, guint32 u3) {

   guchar utf8[16]; 

   utf8[g_unichar_to_utf8(u1, utf8)] = '\0';
   g_signal_emit_by_name(context, "commit", utf8);  
   utf8[g_unichar_to_utf8(u2, utf8)] = '\0';
   g_signal_emit_by_name(context, "commit", utf8);
   utf8[g_unichar_to_utf8(u3, utf8)] = '\0';
   g_signal_emit_by_name(context, "commit", utf8);        
}

//----------------------------------------------------------------
gboolean process_tscii_tamil99(GtkIMContext *context, GdkEventKey *event) {

   guint32 u;

   switch (event->keyval) {

      case GDK_y:
         if (last_sent_unicode == 0xc7) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xfb);
            last_sent_unicode = 0xfb;
         }
         else {
            send_1_unicode_value(context, 0xc7);  
            last_sent_unicode = 0xc7;          
         }
         break;

      case GDK_u:
         if (last_sent_unicode == 0xc8) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xfc);
            last_sent_unicode = 0xfc;
         }
         else {
            send_1_unicode_value(context, 0xc8);  
            last_sent_unicode = 0xc8;          
         }
         break;

      case GDK_i:
         if (last_sent_unicode == 0xc9) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xfd);
            last_sent_unicode = 0xfd;
         }
         else {
            send_1_unicode_value(context, 0xc9);  
            last_sent_unicode = 0xc9;          
         }
         break;

      case GDK_o:
         if (last_sent_unicode == 0xbc) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf0);
            last_sent_unicode = 0xf0;
         }
         else {
            send_1_unicode_value(context, 0xbc);  
            last_sent_unicode = 0xbc;          
         }
         break;

      case GDK_p:
         if (last_sent_unicode == 0xbd) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf1);
            last_sent_unicode = 0xf1;
         }
         else {
            send_1_unicode_value(context, 0xbd);  
            last_sent_unicode = 0xbd;          
         }
         break;

      case GDK_bracketleft:
         if (last_sent_unicode == 0xba) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xee);
            last_sent_unicode = 0xee;
         }
         else {
            send_1_unicode_value(context, 0xba);  
            last_sent_unicode = 0xba;          
         }
         break;

      case GDK_bracketright:
         if (last_sent_unicode == 0xbb) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xef);
            last_sent_unicode = 0xef;
         }
         else {
            send_1_unicode_value(context, 0xbb);  
            last_sent_unicode = 0xbb;          
         }
         break;

      case GDK_h:
         if (last_sent_unicode == 0xb8) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xec);
            last_sent_unicode = 0xec;
         }
         else {
            send_1_unicode_value(context, 0xb8);  
            last_sent_unicode = 0xb8;          
         }
         break;

      case GDK_j:
         if (last_sent_unicode == 0xc0) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf4);
            last_sent_unicode = 0xf4;
         }
         else {
            send_1_unicode_value(context, 0xc0);  
            last_sent_unicode = 0xc0;          
         }
         break;

      case GDK_k:
         if (last_sent_unicode == 0xc1) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf5);
            last_sent_unicode = 0xf5;
         }
         else {
            send_1_unicode_value(context, 0xc1);  
            last_sent_unicode = 0xc1;          
         }
         break;

      case GDK_l:
         if (last_sent_unicode == 0xbe) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf2);
            last_sent_unicode = 0xf2;
         }
         else {
            send_1_unicode_value(context, 0xbe);  
            last_sent_unicode = 0xbe;          
         }
         break;

      case GDK_semicolon:
         if (last_sent_unicode == 0xbf) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf3);
            last_sent_unicode = 0xf3;
         }
         else {
            send_1_unicode_value(context, 0xbf);  
            last_sent_unicode = 0xbf;          
         }
         break;

      case GDK_apostrophe:
         if (last_sent_unicode == 0xc2) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf6);
            last_sent_unicode = 0xf6;
         }
         else {
            send_1_unicode_value(context, 0xc2);  
            last_sent_unicode = 0xc2;          
         }
         break;

      case GDK_v:
         if (last_sent_unicode == 0xc5) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf9);
            last_sent_unicode = 0xf9;
         }
         else {
            send_1_unicode_value(context, 0xc5);  
            last_sent_unicode = 0xc5;          
         }
         break;

      case GDK_b:
         if (last_sent_unicode == 0xb9) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xed);
            last_sent_unicode = 0xed;
         }
         else {
            send_1_unicode_value(context, 0xb9);  
            last_sent_unicode = 0xb9;          
         }
         break;

      case GDK_n:
         if (last_sent_unicode == 0xc4) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf8);
            last_sent_unicode = 0xf8;
         }
         else {
            send_1_unicode_value(context, 0xc4);  
            last_sent_unicode = 0xc4;          
         }
         break;

      case GDK_m:
         if (last_sent_unicode == 0xc3) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xf7);
            last_sent_unicode = 0xf7;
         }
         else {
            send_1_unicode_value(context, 0xc3);  
            last_sent_unicode = 0xc3;          
         }
         break;

      case GDK_slash:
         if (last_sent_unicode == 0xc6) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0xfa);
            last_sent_unicode = 0xfa;
         }
         else {
            send_1_unicode_value(context, 0xc6);  
            last_sent_unicode = 0xc6;          
         }
         break;

      case GDK_Q:
         if (last_sent_unicode == 0x85) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0x8a);
            last_sent_unicode = 0x8a;
         }
         else {
            send_1_unicode_value(context, 0x85);  
            last_sent_unicode = 0x85;          
         }
         break;

      case GDK_W:
         if (last_sent_unicode == 0x84) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0x89);
            last_sent_unicode = 0x89;
         }
         else {
            send_1_unicode_value(context, 0x84);  
            last_sent_unicode = 0x84;          
         }
         break;

      case GDK_E:
         if (last_sent_unicode == 0x83) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0x88);
            last_sent_unicode = 0x88;
         }
         else {
            send_1_unicode_value(context, 0x83);  
            last_sent_unicode = 0x83;          
         }
         break;

      case GDK_R:
         if (last_sent_unicode == 0x86) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0x8b);
            last_sent_unicode = 0x8b;
         }
         else {
            send_1_unicode_value(context, 0x86);  
            last_sent_unicode = 0x86;          
         }
         break;

      case GDK_T:
         if (last_sent_unicode == 0x87) {
            gtk_im_context_delete_surrounding (context, -1, 1);
            send_1_unicode_value(context, 0x8c);
            last_sent_unicode = 0x8c;
         }
         else {
            send_1_unicode_value(context, 0x87);  
            last_sent_unicode = 0x87;          
         }
         break;

      case GDK_Y:         
         send_1_unicode_value(context, 0x82);  
         last_sent_unicode = 0x82;          
         break;

      case GDK_a:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               last_sent_unicode = 0;
         }
         else {
            send_1_unicode_value(context, 0xab);
            last_sent_unicode = 0xab;
         }
         break;

      case GDK_q:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               send_1_unicode_value(context, 0xa1);
               last_sent_unicode = 0xa1;
         }
         else {
            send_1_unicode_value(context, 0xac);
            last_sent_unicode = 0xac;
         }
         break;

      case GDK_s:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               if (last_sent_unicode == 0xbc) {
                  gtk_im_context_delete_surrounding (context, -1, 1);
                  send_1_unicode_value(context, 0xca);
                  last_sent_unicode = 0xca;
               }
               else {
                  send_1_unicode_value(context, 0xa2);
                  last_sent_unicode = 0xa2;
               }
         }
         else {
            send_1_unicode_value(context, 0xfe);
            last_sent_unicode = 0xfe;
         }
         break;

      case GDK_w:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               if (last_sent_unicode == 0xbc) {
                  gtk_im_context_delete_surrounding (context, -1, 1);
                  send_1_unicode_value(context, 0xcb);
                  last_sent_unicode = 0xcb;
               }
               else {
                  send_1_unicode_value(context, 0xa3);
                  last_sent_unicode = 0xa3;
               }
         }
         else {
            send_1_unicode_value(context, 0xae);
            last_sent_unicode = 0xae;
         }
         break;

      case GDK_r:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_2_unicode_value(context, 0xa8, last_sent_unicode);
               last_sent_unicode = 0xa8;
         }
         else {
            send_1_unicode_value(context, 0xb3);
            last_sent_unicode = 0xb3;
         }
         break;

      case GDK_g:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_2_unicode_value(context, 0xa6, last_sent_unicode);
               last_sent_unicode = 0xa6;
         }
         else {
            send_1_unicode_value(context, 0xb1);
            last_sent_unicode = 0xb1;
         }
         break;

      case GDK_t:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_2_unicode_value(context, 0xa7, last_sent_unicode);
               last_sent_unicode = 0xa7;
         }
         else {
            send_1_unicode_value(context, 0xb2);
            last_sent_unicode = 0xb2;
         }
         break;

      case GDK_c:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_3_unicode_value(context, 0xa6, last_sent_unicode, 0xa1);
               last_sent_unicode = 0xa6;
         }
         else {
            send_1_unicode_value(context, 0xb4);
            last_sent_unicode = 0xb4;
         }
         break;

      case GDK_x:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_3_unicode_value(context, 0xa7, last_sent_unicode, 0xa1);
               last_sent_unicode = 0xa7;
         }
         else {
            send_1_unicode_value(context, 0xb5);
            last_sent_unicode = 0xb5;
         }
         break;

      case GDK_z:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9) ||
            (last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_3_unicode_value(context, 0xa6, last_sent_unicode, 0xaa);
               last_sent_unicode = 0xaa;
         }
         else {
            send_1_unicode_value(context, 0xb6);
            last_sent_unicode = 0xb6;
         }
         break;

      case GDK_f:

         if ((last_sent_unicode >= 0xb8 && last_sent_unicode <= 0xc9)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, last_sent_unicode + 52);
               last_sent_unicode = last_sent_unicode + 52;
         }
         else if ((last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, last_sent_unicode + 5);
               last_sent_unicode = last_sent_unicode + 5;
         }
         else {
            send_1_unicode_value(context, 0xb7);
            last_sent_unicode = 0xb7;
         }
         break;

      case GDK_d:

         if (last_sent_unicode == 0xb8) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0xcc);
               last_sent_unicode = 0xcc;  
         }         
         else if (last_sent_unicode == 0xb9) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0x99);
               last_sent_unicode = 0x99;  
         }    
         else if (last_sent_unicode == 0xba) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0xcd);
               last_sent_unicode = 0xcd;  
         } 
         else if (last_sent_unicode == 0xbb) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0x9a);
               last_sent_unicode = 0x9a;  
         } 
         else if ((last_sent_unicode >= 0xbc && last_sent_unicode <= 0xc9)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, last_sent_unicode + 18);
               last_sent_unicode = last_sent_unicode + 18;
         }
         else if ((last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               send_1_unicode_value(context, 0xa4);
               last_sent_unicode = 0xa4;
         }
         else {
            send_1_unicode_value(context, 0xaf);
            last_sent_unicode = 0xaf;
         }
         break;

      case GDK_e:
         if (last_sent_unicode == 0xb8) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0xdc);
               last_sent_unicode = 0xdc;  
         }         
         else if (last_sent_unicode == 0xb9) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0x9b);
               last_sent_unicode = 0x9b;  
         }    
         else if (last_sent_unicode == 0xba) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0xdd);
               last_sent_unicode = 0xdd;  
         } 
         else if (last_sent_unicode == 0xbb) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, 0x9c);
               last_sent_unicode = 0x9c;  
         } 
         else if ((last_sent_unicode >= 0xbc && last_sent_unicode <= 0xc9)) {
               gtk_im_context_delete_surrounding (context, -1, 1);
               send_1_unicode_value(context, last_sent_unicode + 34);
               last_sent_unicode = last_sent_unicode + 34;
         }
         else if ((last_sent_unicode >= 0x83 && last_sent_unicode <= 0x87)) {
               send_1_unicode_value(context, 0xa5);
               last_sent_unicode = 0xa5;
         }
         else {
            send_1_unicode_value(context, 0xb0);
            last_sent_unicode = 0xb0;
         }
         break;

      case GDK_O:
         send_1_unicode_value(context, 0x5b);  
         last_sent_unicode = 0x5b;          
         break;

      case GDK_P:
         send_1_unicode_value(context, 0x5d);  
         last_sent_unicode = 0x5d;          
         break;

      case GDK_M:
         send_1_unicode_value(context, 0x2f);  
         last_sent_unicode = 0x2f;          
         break;

      case GDK_K:
         send_1_unicode_value(context, 0x22);  
         last_sent_unicode = 0x22;          
         break;

      case GDK_L:
         send_1_unicode_value(context, 0x3a);  
         last_sent_unicode = 0x3a;          
         break;

      case GDK_colon:
         send_1_unicode_value(context, 0x3b);  
         last_sent_unicode = 0x3b;          
         break;

      case GDK_quotedbl:
         send_1_unicode_value(context, 0x27);  
         last_sent_unicode = 0x27;          
         break;

      default:

         u = gdk_keyval_to_unicode(event->keyval);
         if (u == 0) {
            return FALSE;
         }
         send_1_unicode_value(context, u);
         last_sent_keysym = event->keyval;
         last_sent_unicode = u;
         break;
   }
   
   return TRUE;
}



Generated by  Doxygen 1.6.0   Back to index