fix a selection text issue of text_editor with pressing shift
This commit is contained in:
@@ -596,9 +596,9 @@ namespace detail
|
||||
case XK_Delete:
|
||||
keysym = keyboard::os_del; break;
|
||||
case XK_Shift_L: case XK_Shift_R: //shift
|
||||
keysym = 0x10; break;
|
||||
keysym = keyboard::os_shift; break;
|
||||
case XK_Control_L: case XK_Control_R: //ctrl
|
||||
keysym = 0x11; break;
|
||||
keysym = keyboard::os_ctrl; break;
|
||||
default:
|
||||
do
|
||||
{
|
||||
@@ -1064,7 +1064,7 @@ namespace detail
|
||||
}
|
||||
else
|
||||
{
|
||||
if(0x11 == os_code)
|
||||
if(keyboard::os_ctrl == os_code)
|
||||
context.is_ctrl_pressed = true;
|
||||
|
||||
arg_keyboard arg;
|
||||
|
||||
@@ -1421,12 +1421,6 @@ namespace nana{ namespace widgets
|
||||
char_type key = arg.key;
|
||||
switch (key)
|
||||
{
|
||||
#if 0
|
||||
case keyboard::os_arrow_left: move_left(); break;
|
||||
case keyboard::os_arrow_right: move_right(); break;
|
||||
case keyboard::os_arrow_up: move_ns(true); break;
|
||||
case keyboard::os_arrow_down: move_ns(false); break;
|
||||
#else
|
||||
case keyboard::os_arrow_left:
|
||||
case keyboard::os_arrow_right:
|
||||
case keyboard::os_arrow_up:
|
||||
@@ -1437,7 +1431,6 @@ namespace nana{ namespace widgets
|
||||
case keyboard::os_pagedown:
|
||||
_handle_move_key(arg);
|
||||
break;
|
||||
#endif
|
||||
case keyboard::os_del:
|
||||
if (this->attr().editable)
|
||||
del();
|
||||
@@ -2328,6 +2321,9 @@ namespace nana{ namespace widgets
|
||||
|
||||
void text_editor::_handle_move_key(const arg_keyboard& arg)
|
||||
{
|
||||
if (arg.shift && (select_.a == select_.b))
|
||||
select_.a = select_.b = points_.caret;
|
||||
|
||||
bool changed = false;
|
||||
nana::upoint caret = points_.caret;
|
||||
char_t key = arg.key;
|
||||
|
||||
Reference in New Issue
Block a user