[gtkmm] Q: keystroke interception



I have never written a program for X windows before.  Since I
want to write a C++ program for Linux, I decided to try gtkmm.
I want the main window to be a text screen where people can
type in commands, but I want to support characters other than
the standard ASCII set by taking advanyage of the gtkmm
support for Unicode.  Basically, I want to read keystrokes in
raw mode, determine whether or not the Control or Alt key
was pressed along with the keystroke, and act accordingly.
Normal characters would be passed through unchanged,
others might be translated to special Unicode characters or
might trigger special commands.  There must be some way to
do this so that people can write editors like emacs, but it's
not clear to me how to do it.

I have copied the example for a text view, and have a window
coming up with a text view in a scroll window, but without the
buttons, which I don't need.  It looks as if trapping the "insert"
signal will not do what I want, so I probably need to trap an X
signal of some sort, but I only want to process keystrokes typed
in my program's window.

I would appreciate any suggestions.

Also, does gtkmm work well with the gunichar type?  I wanted
to support character arrays in which the lengths and number of
dimensions can change, and I was thinking of storing the array
contents as an STL vector of gunichars.

Thanks very much.

--- Brian




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