fix for selected_to_clipboard unpacked copy
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / cwindowgui.C
index 19ff101e3f0383a56ba20b8e9df6a2c981922416..e800cbbe7b92ca5911e58acde73d922582a7ed11 100644 (file)
@@ -463,113 +463,144 @@ int CWindowGUI::keypress_event()
        int result = 0;
        int cwindow_operation = CWINDOW_NONE;
 
-       switch(get_keypress())
-       {
-               case 'w':
-               case 'W':
-                       close_event();
-                       result = 1;
-                       break;
-               case '+':
-               case '=':
-                       keyboard_zoomin();
-                       result = 1;
-                       break;
-               case '-':
-                       keyboard_zoomout();
-                       result = 1;
-                       break;
-               case 'f':
+       switch( get_keypress() ) {
+       case 'w':
+       case 'W':
+               close_event();
+               result = 1;
+               break;
+       case '+':
+       case '=':
+               keyboard_zoomin();
+               result = 1;
+               break;
+       case '-':
+               keyboard_zoomout();
+               result = 1;
+               break;
+       case 'f':
+               unlock_window();
+               if(mwindow->session->cwindow_fullscreen)
+                       canvas->stop_fullscreen();
+               else
+                       canvas->start_fullscreen();
+               lock_window("CWindowGUI::keypress_event 1");
+               result = 1;
+               break;
+       case 'x':
+               if( ctrl_down() || shift_down() || alt_down() ) break;
+               unlock_window();
+               mwindow->gui->lock_window("CWindowGUI::keypress_event 2");
+               mwindow->cut();
+               mwindow->gui->unlock_window();
+               lock_window("CWindowGUI::keypress_event 2");
+               result = 1;
+               break;
+       case DELETE:
+               unlock_window();
+               mwindow->gui->lock_window("CWindowGUI::keypress_event 2");
+               mwindow->clear_entry();
+               mwindow->gui->unlock_window();
+               lock_window("CWindowGUI::keypress_event 3");
+               result = 1;
+               break;
+       case ESC:
+               unlock_window();
+               if(mwindow->session->cwindow_fullscreen)
+                       canvas->stop_fullscreen();
+               lock_window("CWindowGUI::keypress_event 4");
+               result = 1;
+               break;
+       case LEFT:
+               if( !ctrl_down() ) {
+                       int alt_down = this->alt_down();
+                       int shift_down = this->shift_down();
                        unlock_window();
-                       if(mwindow->session->cwindow_fullscreen)
-                               canvas->stop_fullscreen();
+                       stop_transport(0);
+                       mwindow->gui->lock_window("CWindowGUI::keypress_event 5");
+                       if( alt_down )
+                               mwindow->prev_edit_handle(shift_down);
                        else
-                               canvas->start_fullscreen();
-                       lock_window("CWindowGUI::keypress_event 1");
-                       break;
-               case 'x':
-                       if( ctrl_down() || shift_down() || alt_down() ) break;
+                               mwindow->move_left();
+                       mwindow->gui->unlock_window();
+                       lock_window("CWindowGUI::keypress_event 6");
+                       result = 1;
+               }
+               break;
+
+       case ',':
+               if( !ctrl_down() && !alt_down() ) {
                        unlock_window();
-                       mwindow->gui->lock_window("CWindowGUI::keypress_event 2");
-                       mwindow->cut();
+                       stop_transport(0);
+                       mwindow->gui->lock_window("CWindowGUI::keypress_event 7");
+                       mwindow->move_left();
                        mwindow->gui->unlock_window();
-                       lock_window("CWindowGUI::keypress_event 2");
-                       break;
-               case DELETE:
+                       lock_window("CWindowGUI::keypress_event 8");
+                       result = 1;
+               }
+               break;
+
+       case RIGHT:
+               if( !ctrl_down() ) {
+                       int alt_down = this->alt_down();
+                       int shift_down = this->shift_down();
                        unlock_window();
-                       mwindow->gui->lock_window("CWindowGUI::keypress_event 2");
-                       mwindow->clear_entry();
+                       stop_transport(0);
+                       mwindow->gui->lock_window("CWindowGUI::keypress_event 8");
+                       if( alt_down )
+                               mwindow->next_edit_handle(shift_down);
+                       else
+                               mwindow->move_right();
                        mwindow->gui->unlock_window();
-                       lock_window("CWindowGUI::keypress_event 3");
-                       break;
-               case ESC:
+                       lock_window("CWindowGUI::keypress_event 9");
+                       result = 1;
+               }
+               break;
+
+       case '.':
+               if( !ctrl_down() && !alt_down() ) {
                        unlock_window();
-                       if(mwindow->session->cwindow_fullscreen)
-                               canvas->stop_fullscreen();
-                       lock_window("CWindowGUI::keypress_event 4");
-                       break;
-               case LEFT:
-                       if( !ctrl_down() ) {
-                               int alt_down = this->alt_down();
-                               int shift_down = this->shift_down();
-                               unlock_window();
-                               stop_transport(0);
-                               mwindow->gui->lock_window("CWindowGUI::keypress_event 5");
-                               if( alt_down )
-                                       mwindow->prev_edit_handle(shift_down);
-                               else
-                                       mwindow->move_left();
-                               mwindow->gui->unlock_window();
-                               lock_window("CWindowGUI::keypress_event 6");
-                               result = 1;
-                       }
-                       break;
+                       stop_transport(0);
+                       mwindow->gui->lock_window("CWindowGUI::keypress_event 10");
+                       mwindow->move_right();
+                       mwindow->gui->unlock_window();
+                       lock_window("CWindowGUI::keypress_event 11");
+                       result = 1;
+               }
+               break;
+       }
 
-               case ',':
-                       if( !ctrl_down() && !alt_down() ) {
-                               unlock_window();
-                               stop_transport(0);
-                               mwindow->gui->lock_window("CWindowGUI::keypress_event 7");
-                               mwindow->move_left();
-                               mwindow->gui->unlock_window();
-                               lock_window("CWindowGUI::keypress_event 8");
-                               result = 1;
-                       }
+       if( !result && cwindow_operation < 0 && ctrl_down() && shift_down() ) {
+               switch( get_keypress() ) {
+               case KEY_F1:
+               case KEY_F2:
+               case KEY_F3:
+               case KEY_F4:
+                       resend_event(mwindow->gui);
+                       result = 1;
                        break;
-
-               case RIGHT:
-                       if( !ctrl_down() ) {
-                               int alt_down = this->alt_down();
-                               int shift_down = this->shift_down();
-                               unlock_window();
-                               stop_transport(0);
-                               mwindow->gui->lock_window("CWindowGUI::keypress_event 8");
-                               if( alt_down )
-                                       mwindow->next_edit_handle(shift_down);
-                               else
-                                       mwindow->move_right();
-                               mwindow->gui->unlock_window();
-                               lock_window("CWindowGUI::keypress_event 9");
-                               result = 1;
+               }
+       }
+       if( !result && !ctrl_down() ) {
+               switch( get_keypress() ) {
+               case KEY_F1:
+                       if( shift_down() ) {
+                               mwindow->toggle_camera_xyz();  result = 1;
                        }
+                       else
+                               cwindow_operation = CWINDOW_PROTECT;
                        break;
-
-               case '.':
-                       if( !ctrl_down() && !alt_down() ) {
-                               unlock_window();
-                               stop_transport(0);
-                               mwindow->gui->lock_window("CWindowGUI::keypress_event 10");
-                               mwindow->move_right();
-                               mwindow->gui->unlock_window();
-                               lock_window("CWindowGUI::keypress_event 11");
-                               result = 1;
+               case KEY_F2:
+                       if( shift_down() ) {
+                               mwindow->toggle_projector_xyz();  result = 1;
                        }
+                       else
+                               cwindow_operation = CWINDOW_ZOOM;
                        break;
-
-               case KEY_F1: if( shift_down() ) { mwindow->toggle_camera_xyz();  break; }
-                               cwindow_operation = CWINDOW_PROTECT;    break;
-               case KEY_F2: if( shift_down() ) { mwindow->toggle_projector_xyz();  break; }
-                               cwindow_operation = CWINDOW_ZOOM;       break;
+               }
+       }
+       if( !result && cwindow_operation < 0 && !ctrl_down() && !shift_down() ) {
+               switch( get_keypress() ) {
                case KEY_F3:    cwindow_operation = CWINDOW_MASK;       break;
                case KEY_F4:    cwindow_operation = CWINDOW_RULER;      break;
                case KEY_F5:    cwindow_operation = CWINDOW_CAMERA;     break;
@@ -578,8 +609,9 @@ int CWindowGUI::keypress_event()
                case KEY_F8:    cwindow_operation = CWINDOW_EYEDROP;    break;
                case KEY_F9:    cwindow_operation = CWINDOW_TOOL_WINDOW; break;
                case KEY_F10:   cwindow_operation = CWINDOW_TITLESAFE;  break;
-               case KEY_F11:   canvas->reset_camera();                 break;
-               case KEY_F12:   canvas->reset_projector();              break;
+               case KEY_F11:   canvas->reset_camera();    result = 1;  break;
+               case KEY_F12:   canvas->reset_projector(); result = 1;  break;
+               }
        }
 
        if( cwindow_operation >= 0 ) {
@@ -587,7 +619,8 @@ int CWindowGUI::keypress_event()
                result = 1;
        }
 
-       if(!result) result = transport->keypress_event();
+       if( !result )
+               result = transport->keypress_event();
 
        return result;
 }
@@ -689,7 +722,7 @@ int CWindowGUI::drag_stop()
                {
                        mwindow->save_backup();
                        mwindow->restart_brender();
-                       mwindow->gui->update(1, 1, 1, 1, 0, 1, 0);
+                       mwindow->gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0);
                        mwindow->undo->update_undo_after(_("insert assets"), LOAD_ALL);
                        mwindow->gui->unlock_window();
                        mwindow->sync_parameters(CHANGE_ALL);