diff --git a/lib/qtermwidget.cpp b/lib/qtermwidget.cpp index 126025a..b78bcd5 100644 --- a/lib/qtermwidget.cpp +++ b/lib/qtermwidget.cpp @@ -296,6 +296,7 @@ void QTermWidget::init(int startnow) m_searchBar->setFont(font); setScrollBarPosition(NoScrollBar); + setKeyboardCursorShape(BlockCursor); m_impl->m_session->addView(m_impl->m_terminalDisplay); @@ -641,3 +642,10 @@ int QTermWidget::getPtySlaveFd() const { return m_impl->m_session->getPtySlaveFd(); } + +void QTermWidget::setKeyboardCursorShape(KeyboardCursorShape shape) +{ + if (!m_impl->m_terminalDisplay) + return; + m_impl->m_terminalDisplay->setKeyboardCursorShape((TerminalDisplay::KeyboardCursorShape)shape); +} diff --git a/lib/qtermwidget.h b/lib/qtermwidget.h index f442b16..760d42f 100644 --- a/lib/qtermwidget.h +++ b/lib/qtermwidget.h @@ -41,6 +41,21 @@ public: ScrollBarRight=2 }; + enum KeyboardCursorShape { + /** A rectangular block which covers the entire area of the cursor character. */ + BlockCursor, + /** + * A single flat line which occupies the space at the bottom of the cursor + * character's area. + */ + UnderlineCursor, + /** + * An cursor shaped like the capital letter 'I', similar to the IBeam + * cursor used in Qt/KDE text editors. + */ + IBeamCursor + }; + //Creation of widget QTermWidget(int startnow, // 1 = start shell programm immediatelly QWidget * parent = 0); @@ -176,6 +191,12 @@ public: */ int getPtySlaveFd() const; + /** + * Sets the shape of the keyboard cursor. This is the cursor drawn + * at the position in the terminal where keyboard input will appear. + */ + void setKeyboardCursorShape(KeyboardCursorShape shape); + signals: void finished(); void copyAvailable(bool);