~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_userInterfaces/ADM_GTK/ADM_gui2/GUI_keymap.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          GUI_binding.cpp  -  description
 
3
                             -------------------
 
4
    begin                : Fri Jan 17 2003
 
5
    copyright            : (C) 2003 by mean
 
6
    email                : fixounet@free.fr
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
#include <stdio.h>
 
18
#include <stdlib.h>
 
19
#  include <config.h>
 
20
/*******************THIS IS NOT USED ANYMORE********************/
 
21
/*******************THIS IS NOT USED ANYMORE********************/
 
22
/*******************THIS IS NOT USED ANYMORE********************/
 
23
/*******************THIS IS NOT USED ANYMORE********************/
 
24
/*******************THIS IS NOT USED ANYMORE********************/
 
25
/*******************THIS IS NOT USED ANYMORE********************/
 
26
/*******************THIS IS NOT USED ANYMORE********************/
 
27
/*******************THIS IS NOT USED ANYMORE********************/
 
28
/*******************THIS IS NOT USED ANYMORE********************/
 
29
 
 
30
#include <string.h>
 
31
 
 
32
#include <gdk/gdkkeysyms.h>
 
33
#include <gtk/gtk.h>
 
34
 
 
35
#include "math.h"
 
36
#include "default.h"
 
37
 
 
38
#include "../gui_action.hxx"
 
39
extern void HandleAction(Action act);  
 
40
// when keys are pressed
 
41
// We have to duplicate the ALT ... shortcut
 
42
// because of change of focus ?
 
43
 
 
44
gboolean UI_on_key_press(GtkWidget *widget, GdkEventKey* event, gpointer user_data)
 
45
{
 
46
    UNUSED_ARG(widget);
 
47
    UNUSED_ARG(user_data);
 
48
        gboolean shift = FALSE;
 
49
        gboolean ctrl = FALSE;
 
50
        gboolean alt = FALSE;
 
51
        Action action;
 
52
 
 
53
        //printf("key : %d (%c) \n",event->keyval,event->keyval);
 
54
        
 
55
        if (event->state & GDK_CONTROL_MASK)
 
56
        {
 
57
                ctrl = TRUE;
 
58
        }
 
59
        if (event->state & GDK_SHIFT_MASK)
 
60
        {
 
61
                shift = TRUE;
 
62
        }
 
63
        if(event->state & GDK_MOD1_MASK)
 
64
        {
 
65
                alt = TRUE;
 
66
        }
 
67
        // ALT+x
 
68
        //_____________
 
69
        
 
70
        action=ACT_DUMMY;
 
71
        
 
72
 
 
73
    switch (event->keyval)
 
74
        {       
 
75
        case GDK_Up:
 
76
                action=ACT_NextKFrame;
 
77
                break;
 
78
        case GDK_Down:
 
79
                action=ACT_PreviousKFrame;
 
80
                break;
 
81
                        
 
82
                // Position advance
 
83
        case GDK_Left: case GDK_KP_Left:
 
84
 
 
85
                // One frame
 
86
                if((shift == FALSE) && (ctrl == FALSE))
 
87
                {
 
88
                        action = ACT_PreviousFrame;
 
89
                }
 
90
                // 100 frames
 
91
                else if((shift == TRUE) && (ctrl == TRUE))
 
92
                {
 
93
                        action = ACT_Back100Frames;
 
94
                }
 
95
                // 50 frames
 
96
                else if(ctrl == TRUE)
 
97
                {
 
98
                        action = ACT_Back50Frames;
 
99
                }
 
100
                // 25 frames
 
101
                else
 
102
                {
 
103
                        action = ACT_Back25Frames;
 
104
                }
 
105
                break;
 
106
 
 
107
                // Position reverse
 
108
        case GDK_Right: case GDK_KP_Right:
 
109
                if((shift == FALSE) && (ctrl == FALSE))
 
110
                {
 
111
                        action = ACT_NextFrame;
 
112
                }
 
113
                // 100 frames
 
114
                else if((shift == TRUE) && (ctrl == TRUE))
 
115
                {
 
116
                        action = ACT_Forward100Frames;
 
117
                }
 
118
 
 
119
                else if(ctrl == TRUE)
 
120
                {
 
121
                        action = ACT_Forward50Frames;
 
122
                }
 
123
                else
 
124
                {
 
125
                        action = ACT_Forward25Frames;
 
126
                }
 
127
                break;
 
128
                
 
129
        }
 
130
        if(action!=ACT_DUMMY) // For me to handle
 
131
        {
 
132
               HandleAction(action);
 
133
               return TRUE;
 
134
        }
 
135
        return FALSE;
 
136
}