Commit Graph

19 Commits

Author SHA1 Message Date
Yen Chi Hsuan 4ffd19203a Fix numpad handling and add entries for numpad 5
KP_Clear is mapped from numpad 5 on non-Apple keyboards according to Qt
doc [1]. It's mapped from KP_Begin from XKB on X11.

Tests: with numlock off,

numpad 5 => "\e[OE"
Ctrl + numpad 5 => "\e[1;5E"
Alt + numpad 5 => "\e[1;3E"
Shift + numpad 5 => "5"

These results are the same as VTE3 0.56.3. On xterm 346, Shift + numpad
5 generates "\eO2u". However, Qt returns 5 instead of KP_Clear if Shift
is hold even with numlock off, so implementing Shift + numpad 5 might be
rather complicated. As a side note, shifted keypad sequences can be
found in emacs sources [2].

Note that on Wayfire (wlroots-based Wayland compositor), numpad 5 with
numlock off generates an event without Qt::KeypadModifier. Further
investigation needed.

Ref: https://github.com/lxqt/qtermwidget/issues/117

[1] https://doc.qt.io/qt-5/qt.html#Key-enum
[2] https://github.com/emacs-mirror/emacs/blame/master/lisp/term/xterm.el
2019-07-15 22:38:35 +02:00
Luís Pereira 2110583a39 Port towards C++ headers 2019-04-13 15:49:15 +02:00
Luís Pereira b8906f6b0c Port towards C++11 nullptr 2019-04-13 15:49:15 +02:00
Andrew Janke 5ce909cbc2 Swap Qt::ControlModifier and Qt::MetaModifier on Mac
This is because their meaning is different there.
See https://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum
2019-03-21 11:02:14 +08:00
Pavel Shlyak 3da204b68d Cleanup KeyboardTranslator.cpp
The value is assigned twice. Seems to be unnecessary :)
2019-01-20 14:17:43 +01:00
Luís Pereira c6880070e9 Don't use automatic string conversions
* Disables automatic conversions from 8-bit strings (char *) to unicode
  QStrings.
* Disables automatic conversion from QString to 8-bit strings (char *).
* Disables automatic conversions from QByteArray to const char * or const
  void *.
* Disables automatic conversions from QString (or char *) to QUrl.
* Use QStringBuilder for more efficient string creation.

It make us aware of string and encoding conversions.
2018-08-05 22:09:57 +08:00
Donnie West d84849b04b Backport Vt102 emulation fixes (#113)
Also pull in KeyboardTranslator and Character updates
2017-04-24 21:26:56 +02:00
Luís Pereira 3ce71a3650 Fixes (#122)
* Prevent a possible C++11 range for detach

The solution with Qt>=5.7 is to use the qAsConst() macro.
But the qAsConst macro is just a const_cast to const T&.

* Don't call QByteArray::operator[]() on temporary

Just use the QByteArray::at().

* Adds missing reference in foreach

That's an non non trivial type (QString), using a reference as no drawbacks
and it performs better.

* Use QStringList::constFirst()

Drop QStringList::first(). It's faster and we might avoid detaching a
temporary.

* Don't call QList::operator[]() on temporary objects

It's not what we want. The at operator and QList::value() do the job in the
right way.

* Stops allocating an unneeded temporary container

We were allocating an temporary container (_entries.values(keyCode)) which
implies an extra iteration also.
Now we don't use any temporary container and only perform one iteration.
2017-04-22 11:55:16 +02:00
Igor ef451424d7 Backport konsole changes to fix memory leaks
Fixes #58
2016-05-18 14:01:45 +03:00
Jerome Leclanche 72ffc262eb Clean up trailing whitespaces 2015-07-09 20:22:48 +02:00
Petr Vanek 5d3ef34cc2 fixed #11 compile against Qt 5 (Qt4 and Qt5 supported and waguely tested) 2014-04-11 21:28:52 +02:00
Petr Vanek 6ad5d7070a merge changes from the experimental "bundle" repository 2011-06-22 13:12:21 +02:00
Petr Vanek 451928044f fix for kb-layout location on mac (mainly) 2010-11-29 21:16:36 +01:00
Petr Vanek 520661ab6f Merge branch 'master' of file:///export/home/pvanek/oss/qterm/merge/qtermwidget
Conflicts:
	lib/BlockArray.cpp
	lib/BlockArray.h
	lib/CMakeLists.txt
	lib/Character.h
	lib/CharacterColor.h
	lib/Emulation.cpp
	lib/Emulation.h
	lib/Filter.cpp
	lib/Filter.h
	lib/History.cpp
	lib/History.h
	lib/KeyboardTranslator.cpp
	lib/KeyboardTranslator.h
	lib/Pty.cpp
	lib/Pty.h
	lib/Screen.cpp
	lib/Screen.h
	lib/ScreenWindow.cpp
	lib/ScreenWindow.h
	lib/Session.cpp
	lib/Session.h
	lib/ShellCommand.cpp
	lib/ShellCommand.h
	lib/TerminalCharacterDecoder.cpp
	lib/TerminalCharacterDecoder.h
	lib/TerminalDisplay.cpp
	lib/TerminalDisplay.h
	lib/Vt102Emulation.cpp
	lib/Vt102Emulation.h
	lib/k3process.cpp
	lib/k3process.h
	lib/k3processcontroller.cpp
	lib/k3processcontroller.h
	lib/konsole_wcwidth.cpp
	lib/konsole_wcwidth.h
	lib/kpty.cpp
	lib/kpty.h
	lib/kpty_p.h
	lib/qtermwidget.cpp
	lib/qtermwidget.h
2010-10-04 11:29:18 +02:00
Petr Vanek 25661234c0 K&R formatting 2010-10-01 16:08:52 +02:00
Petr Vanek 57fd23bf39 K&R formatting 2010-10-01 16:08:14 +02:00
Petr Vanek 88b5a11bb4 merge with qscite 2010-10-01 15:54:31 +02:00
Petr Vanek 9a778c44df key layouts can be read and provided to widget 2010-09-24 13:27:10 +02:00
Petr Vanek 2d6c2b82b7 initial import 2010-09-11 10:50:46 +02:00