octave-maintainers
[Top][All Lists]
Advanced

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

Re: Terminal input in the GUI vs. Qt keyboard shortcuts


From: Daniel J Sebald
Subject: Re: Terminal input in the GUI vs. Qt keyboard shortcuts
Date: Wed, 15 May 2013 18:56:57 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 05/15/2013 05:49 PM, Daniel J Sebald wrote:
On 05/15/2013 05:39 PM, John W. Eaton wrote:
I've been unable to find a way to avoid conflicts between Qt keyboard
shortcuts and the terminal input that readline is handling. I'm
wondering if this is a fundamental problem that can't be solved if we
are hooking readline directly to stdin for the process.

Can anyone shed some light on this? I'd really like to know whether the
way we are embedding the terminal widget has a chance of working, or
whether there is a fatal flaw here that we aren't going to be able to
work around no matter what we do.

Comments?

I haven't looked at this. Have you tried to get at the level where the
shortcuts are handled? It seems to me that maybe a better way is instead
of trying to use linux OS level communication is to override the
keyboard handling element of Qt with a function that first checks if the
terminal window is the window in focus and then pass that onto readline
somehow. Or the control-keys could generally be passed onto the
terminal, depending upon on how one wants to treat it.

And what about libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp. What is KeyboardTranslator.cpp meant for? I'm guessing it isn't used in this case, i.e., no translations present...although it looks as though someone could define such in a file called "kb-layouts/" + name + ".keytab".

Having looked at the code a bit, it does seem like there isn't much that can be done beyond what I suggested last time. You might be able to leave the readline/stdin of QUnixTerminalImpl::connectToPty() as is. The only thing needed is a way to stop the messages/events going to Qt app and redirect them to the terminal window.

This discussion:

http://qt-project.org/forums/viewthread/2223

seems to do just that, but it looks like it only applies to the window. That is, one could put similar code inside terminal-dock-widget.h but then Cntrl-C (for example) would only be redirected when it is typed inside the terminal window. I don't have any problem with that for a start.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]