[vte] widget: Fix debug output to use the event wrapper
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Fix debug output to use the event wrapper
- Date: Fri, 1 May 2020 21:10:54 +0000 (UTC)
commit 56132ed80fcff068769e85888278d4587d26151e
Author: Christian Persch <chpe src gnome org>
Date: Fri May 1 23:08:42 2020 +0200
widget: Fix debug output to use the event wrapper
src/vte.cc | 2 +-
src/vteinternal.hh | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 82f758f8..90f5adef 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -4554,7 +4554,7 @@ Terminal::widget_key_press(KeyEvent const& event)
"Keypress, modifiers=0x%x, "
"keyval=0x%x, raw string=`%s'.\n",
m_modifiers,
- keyval, ((GdkEventKey*)event.platform_event())->string);
+ keyval, event.string());
/* We steal many keypad keys here. */
if (!m_im_preedit_active) {
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 1b934106..d1b19d7f 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -361,6 +361,11 @@ public:
constexpr auto const is_key_press() const noexcept { return type() == Type::eKEY_PRESS; }
constexpr auto const is_key_release() const noexcept { return type() == Type::eKEY_RELEASE; }
+ auto const string() const noexcept
+ {
+ return reinterpret_cast<GdkEventKey*>(platform_event())->string;
+ }
+
private:
unsigned m_modifiers;
unsigned m_keyval;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]