[Konsole-devel] Re: command handling

Tomáš Čech tcech at suse.cz
Fri Mar 18 13:01:03 UTC 2011


Hi,

On Thu, Mar 17, 2011 at 07:24:33PM +0100, Tomáš Čech wrote:
>Hi,
>
>as you probably noticed I created bug report #267100. I've already created
>patch for xterm and rxvt and I would like do similar work for Konsole.
>
>1] I read the code and found this (I'm using my 4.6.0 KDE version now,
>so line numbers may differ a bit):
>
>Vt102Emulation.cpp:949
>// TODO command handling
>
>TerminalDisplay.cpp:2487-2509
>// Keyboard-based navigation
>...
>
>This feature doesn't work, because shift+pageup/pagedown/up/down
>handling is done in TerminalDisplay.cpp and not in Vt102Emulation.cpp.
>
>I already created ugly version doing what I want, but I'd like to do
>it clearly and acceptable.
>
>How do you want it have it done so it would be accepted?
>
>----------------------------------------------------------------------------
>My proposal is something like:
>
>- create event derived class - QKeyEvent with current TerminalDisplay
>  pointer and instead of handling scroll key combinations set
>        if (( event->key() == Qt::Key_PageUp ) ||
>            ( event->key() == Qt::Key_PageDown ) ||
>            ( event->key() == Qt::Key_Up ) ||
>            ( event->key() == Qt::Key_Down ))
>            event->terminalDisplay = this;

This is not correct - every event should have terminalDisplay
initialized since mapping can change..

>
>- create public method for scrolling of ScreenWindow (something like
>  this)
>
>void TerminalDisplay::scrollScreenWindow( RelativeScrollMode mode , int amount )
>{
> _screenWindow->scrollBy( mode , amount);
>        _screenWindow->setTrackOutput( _screenWindow->atEndOfOutput());
>        updateLineProperties();
>        updateImage();
>}
>
>- in Vt102Emulation::sendKeyEvent add something like
>
>if ( entry.command() & KeyboardTranslator::ScrollPageUpCommand )
>  event->terminalDisplay->scrollScreenWindow( ScreenWindow::ScrollPages , -1 );
>else if ( entry.command() & KeyboardTranslator::ScrollPageDownCommand )
>  event->terminalDisplay->scrollScreenWindow( ScreenWindow::ScrollPages , 1 );
>else if ( entry.command() & KeyboardTranslator::ScrollLineUpCommand )
>  event->terminalDisplay->scrollScreenWindow( ScreenWindow::ScrollLines , -1 );
>else if ( entry.command() & KeyboardTranslator::ScrollLineDownCommand )
>  event->terminalDisplay->scrollScreenWindow( ScreenWindow::ScrollLines , 1 );
>
>
>(I hope I don't get to hell with RelativeScrollMode)
>----------------------------------------------------------------------------
>
>2] I'm looking for proper character sequence which should be sent on
>shift+pageup/pagedown/up/down. Do you have any idea?
>
>
>Best regards,
>
>Tomas Cech
>Sleep_Walker

rest of that still stands.

Best regards,

Tomas Cech
Sleep_Walker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20110318/3ea49888/attachment.sig>


More information about the konsole-devel mailing list