mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 17:25:32 +00:00
Enable the middle mouse button for the textwidget.
This commit is contained in:
parent
e37617f663
commit
d4a058fcc0
@ -35,6 +35,13 @@ ttext_::ttext_()
|
||||
{
|
||||
connect_signal<event::SDL_KEY_DOWN>(boost::bind(
|
||||
&ttext_::signal_handler_sdl_key_down, this, _2, _3, _5, _6, _7));
|
||||
|
||||
#ifdef __unix__
|
||||
// pastes on UNIX systems.
|
||||
connect_signal<event::MIDDLE_BUTTON_CLICK>(boost::bind(
|
||||
&ttext_::signal_handler_middle_button_click, this, _2, _3));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void ttext_::mouse_move(tevent_handler&)
|
||||
@ -314,6 +321,16 @@ void ttext_::handle_key_default(
|
||||
}
|
||||
}
|
||||
|
||||
void ttext_::signal_handler_middle_button_click(
|
||||
const event::tevent event, bool& handled)
|
||||
{
|
||||
DBG_GUI_E << get_control_type() << "[" << id() << "]: " << event << ".\n";
|
||||
|
||||
paste_selection(true);
|
||||
|
||||
handled = true;
|
||||
}
|
||||
|
||||
void ttext_::signal_handler_sdl_key_down(const event::tevent event
|
||||
, bool& handled
|
||||
, const SDLKey key
|
||||
|
@ -421,6 +421,9 @@ protected:
|
||||
|
||||
/***** ***** ***** signal handlers ***** ****** *****/
|
||||
|
||||
void signal_handler_middle_button_click(
|
||||
const event::tevent event, bool& handled);
|
||||
|
||||
void signal_handler_sdl_key_down(const event::tevent event, bool& handled
|
||||
, const SDLKey key, SDLMod modifier, const Uint16 unicode);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user