Hi Miklos,
After digging in some more, I was able to track down the hardware key events to gtk3gtkframe.cxx in
vcl/unx/gtk3. Hopefully this information is useful for others looking for the same information.
Within doKeyCallback function, I set mnCharCode in the SalKeyEvent object to the value I want and
this value is reflected in the LayoutText function of CommonSalLayout.cxx.
Coming to the actual display, I faced two problems. I was able to display my glyph by hard coding
the value of nGlyphIndex in LayoutText but that results in every single character in libreoffice
printing my glyph (on every menu item, label, etc.). I need to figure out how to display my glyph
based on the value passed into the LayoutText function based on mapping this value to the value of
the nGlyphIndex. The mapping is the easy part but identifying the control flow is where things seem
to get tricky. Print statements do not seem to help as they get printed multiple times for a single
keystroke (18 times) and I am unsure which invocation in the loop is the relevant one and an
attempt to insert an if condition based on the value I passed seemed to have no effect.
The other problem I had when I hard coded the value of nGlyphIndex is that the cursor does not move
all the way to the end of the glyph but is in the center of the glyph so that the next keystroke
results in an overlap of the right half of the glyph with the left half of the next glyph. This is
the case only with the glyph in the font file I generated. Note that I have used my fontfile with
other programs written using Gtk+ and they work fine.
Any ideas would be appreciated.
-a
On Monday, February 17, 2020, 2:36:57 AM CST, Miklos Vajna <vmiklos@collabora.com> wrote:
Hi Arvind,
Try 'git grep key_press vcl/source/', and keep in mind that if you type
into a Writer document, Calc cell or Impress shape, those are all
"custom widgets" in terms of gtk3.
Regards,
Miklos
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.