I thought I had found a way to determine focus, but it remains inconsistant. I
was attempting to use the FocusCallback property as the trigger. Within this,
I created a while loop to walk through all events for the widget and determine
if the event was a FocusIn, FocusOut, EnterNotify, or LeaveNotify. This would
merely set or reset a flag if the window appeared to remain in focus after the
while loop. I used the XPending function as the while loop counter to make
sure I processed all current events. Then the plan was to use the flag to
define the delete key to our own delete function, only while the window was in
focus. Then reset the delete key when out of focus. Sounded fairly straight
forward to me, but after weeks of experimentation, I have given up. The two
major problems I encountered was the focus routine would work about 75% of the
time and I could not find out why. The other problem was that I could not find
a way to map the delete key to our delete function. So I have moved on to
bigger and better things.
This message posted from opensolaris.org