diff options
| author | Manolo Gouy <Manolo> | 2016-04-01 14:49:29 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-01 14:49:29 +0000 |
| commit | 20b00f29ce8097565e329638e19a25ab16a86e16 (patch) | |
| tree | dc8ec8a66f5ec9d428e21feb876e31f02e268ee5 /src/drivers | |
| parent | 88ab084e9aea8fa2d5ceeab0b8bc030c02eedf1f (diff) | |
Rewrite Fl_Text_Editor.cxx under the driver model.
Fl_Cocoa_Screen_Driver contains the Mac OS-specific text editor key bindings.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11497 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H index 0c0d64566..34bf6b6ce 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H @@ -53,6 +53,7 @@ protected: static int insertion_point_height; static bool insertion_point_location_is_valid; public: + Fl_Cocoa_Screen_Driver(); // --- display management // --- screen configuration virtual void init(); diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 470aa2c77..6f616cb56 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -43,6 +43,29 @@ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() return new Fl_Cocoa_Screen_Driver(); } +static Fl_Text_Editor::Key_Binding extra_bindings[] = { + // Define CMD+key accelerators... + { 'z', FL_COMMAND, Fl_Text_Editor::kf_undo ,0}, + { 'x', FL_COMMAND, Fl_Text_Editor::kf_cut ,0}, + { 'c', FL_COMMAND, Fl_Text_Editor::kf_copy ,0}, + { 'v', FL_COMMAND, Fl_Text_Editor::kf_paste ,0}, + { 'a', FL_COMMAND, Fl_Text_Editor::kf_select_all ,0}, + { FL_Left, FL_COMMAND, Fl_Text_Editor::kf_meta_move ,0}, + { FL_Right, FL_COMMAND, Fl_Text_Editor::kf_meta_move ,0}, + { FL_Up, FL_COMMAND, Fl_Text_Editor::kf_meta_move ,0}, + { FL_Down, FL_COMMAND, Fl_Text_Editor::kf_meta_move ,0}, + { FL_Left, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move ,0}, + { FL_Right, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move ,0}, + { FL_Up, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move ,0}, + { FL_Down, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move ,0}, + { 0, 0, 0 ,0} +}; + + +Fl_Cocoa_Screen_Driver::Fl_Cocoa_Screen_Driver() { + text_editor_extra_key_bindings = extra_bindings; +} + void Fl_Cocoa_Screen_Driver::init() { |
