Re: Gtk+2 Textview, (editor) compiled on Windows and 'i' interpreted as 'ctrl+i' (indent)?



On 06/21/2017 04:11 AM, David C. Rankin wrote:

  Well, I have identified the problem, and have a work-around, even if I
haven't solved it. Here is the code I originally posted which provides
'ctrl+i' for indent and 'shift+ctrl+i' for unindent:

    ...
    gtk_widget_add_accelerator (indentMi, "activate", mainaccel,
                                GDK_KEY_i, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
    gtk_widget_add_accelerator (unindentMi, "activate", mainaccel,
                                GDK_KEY_i, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
                                GTK_ACCEL_VISIBLE);


The problem was caused by the next set of menu accelerators that make use of
'i' with the GDK_SUPER_MASK. For whatever reason under the great God of
coding, setting the following 'win+i' (indent by fixed amount ignoring
tabstops) and 'win+shift+i' to unindent a fixed amount, causes the textview to
interpret 'i' as 'ctrl+i'. Commenting out the following code restored normal
operation to the 'i' and its 'ctrl' combinations, e.g.

    //~ gtk_widget_add_accelerator (indfixedMi, "activate", mainaccel,
                                //~ GDK_KEY_i, GDK_SUPER_MASK,
                                //~ GTK_ACCEL_VISIBLE);
    //~ gtk_widget_add_accelerator (undfixedMi, "activate", mainaccel,
                                //~ GDK_KEY_i, GDK_SUPER_MASK | GDK_SHIFT_MASK,
                                //~ GTK_ACCEL_VISIBLE);

(indent/unindent work fine)

There is no logic that I find that says using GDK_SUPER_MASK + 'i' will screw
up your GDK_CONTROL_MASK + 'i' accelerators. This is something funky. I like
Joël's thought that it may be a UFT-8, ASCII, (whatever western encoding
windows uses) problem, but why simply removing the GDK_SUPER_MASK accelerators
fixed my issues doesn't seem encoding related. It just seems like something is
wrong if the GDK_SUPER_MASK is assigned in Windows?

Given the removal of the GDK_SUPER_MASK resolved the issue, if anyone has any
information on what GDK_SUPER_MASK can be used for in gtk on windows (or if it
just can't be used), I would appreciate your thoughts or links.

------one down one to go----------

Now all I have to do is figure out how to fix
gtk_source_language_manager_set_search_path () on windows so it can find my
sourceview language files in
"C:\opt\gtk2\share\gtksourceview-2.0\language-specs" (which isn't the
/usr/share/... Linux has). I'll just dump the current defaults and add this to
the beginning. I guess there is no accommodation in the gtksourceview package,
or guards for win32, that would attempt to handle the language-specs location
in a way different from Linux...

Thanks again for all your help.


-- 
David C. Rankin, J.D.,P.E.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]