fix shift+tab issue

This commit is contained in:
Jinhao 2015-04-23 02:49:05 +08:00
parent b053df5fec
commit 535ef19977
2 changed files with 7 additions and 4 deletions

View File

@ -172,7 +172,7 @@ namespace detail
{ {
int pending; int pending;
{ {
nana::detail::platform_scope_guard psg; nana::detail::platform_scope_guard lock;
pending = ::XPending(display_); pending = ::XPending(display_);
if(pending) if(pending)
{ {

View File

@ -371,6 +371,7 @@ namespace detail
XKeyEvent xkey; XKeyEvent xkey;
nana::detail::platform_spec::instance().read_keystate(xkey); nana::detail::platform_spec::instance().read_keystate(xkey);
arg.ctrl = (xkey.state & ControlMask); arg.ctrl = (xkey.state & ControlMask);
arg.shift = (xkey.state & ShiftMask);
} }
bool bedrock::set_keyboard_shortkey(bool yes) bool bedrock::set_keyboard_shortkey(bool yes)
@ -981,8 +982,8 @@ namespace detail
else else
{ {
nana::detail::platform_scope_guard psg; nana::detail::platform_scope_guard psg;
status = XLookupBoth; status = XLookupKeySym;
len = ::XLookupString(&xevent.xkey, keybuf, 32, &keysym, 0); keysym = ::XLookupKeysym(&xevent.xkey, 0);
} }
keybuf[len] = 0; keybuf[len] = 0;
@ -1019,7 +1020,9 @@ namespace detail
context.platform.keychar = keychar; context.platform.keychar = keychar;
if(keychar == keyboard::tab && (false == (msgwnd->flags.tab & detail::tab_type::eating))) //Tab if(keychar == keyboard::tab && (false == (msgwnd->flags.tab & detail::tab_type::eating))) //Tab
{ {
auto the_next = brock.wd_manager.tabstop(msgwnd, true); arg_keyboard argkey;
brock.get_key_state(argkey);
auto the_next = brock.wd_manager.tabstop(msgwnd, !argkey.shift);
if(the_next) if(the_next)
{ {
brock.wd_manager.set_focus(the_next, false); brock.wd_manager.set_focus(the_next, false);