diff --git a/include/nana/gui/detail/general_events.hpp b/include/nana/gui/detail/general_events.hpp index 5992f1a0..72b4cbf3 100644 --- a/include/nana/gui/detail/general_events.hpp +++ b/include/nana/gui/detail/general_events.hpp @@ -1,7 +1,7 @@ /** * Definition of General Events * Nana C++ Library(http://www.nanapro.org) -* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) +* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -460,8 +460,9 @@ namespace nana ::nana::window window_handle; ///< A handle to the event window mutable wchar_t key; ///< the key corresponding to the key pressed mutable bool ignore; ///< this member is only available for key_char event, set 'true' to ignore the input. - bool ctrl; ///< keyboard Ctrl is pressed? - bool shift; ///< keyboard Shift is pressed + bool alt; ///< it is set to indicate the modifier key Alt just prior to the event. + bool ctrl; ///< it is set to indicate the modifier key Ctrl just prior to the event. + bool shift; ///< it is set to indicate the modifier key Shift just prior to the event. }; struct arg_move : public event_arg diff --git a/source/gui/detail/bedrock_posix.cpp b/source/gui/detail/bedrock_posix.cpp index ac297366..131d42de 100644 --- a/source/gui/detail/bedrock_posix.cpp +++ b/source/gui/detail/bedrock_posix.cpp @@ -223,6 +223,7 @@ namespace detail { XKeyEvent xkey; nana::detail::platform_spec::instance().read_keystate(xkey); + arg.alt = (xkey.state & Mod1Mask); arg.ctrl = (xkey.state & ControlMask); arg.shift = (xkey.state & ShiftMask); } diff --git a/source/gui/detail/bedrock_windows.cpp b/source/gui/detail/bedrock_windows.cpp index 9618c47e..96aaed8f 100644 --- a/source/gui/detail/bedrock_windows.cpp +++ b/source/gui/detail/bedrock_windows.cpp @@ -1622,6 +1622,7 @@ namespace detail void bedrock::get_key_state(arg_keyboard& kb) { + kb.alt = (0 != (::GetKeyState(VK_MENU) & 0x80)); kb.ctrl = (0 != (::GetKeyState(VK_CONTROL) & 0x80)); kb.shift = (0 != (::GetKeyState(VK_SHIFT) & 0x80)); }