1# movie.tcl
2#
3# This file defines the default bindings for the movie widget and provides
4# procedures that help in implementing those bindings.
5#
6# Copyright (c) 2004 Mats Bengtsson
7#
8# $Id: movie.tcl,v 1.3 2007/03/06 07:46:57 matben Exp $
9
10#-------------------------------------------------------------------------
11# The code below creates the default class bindings for movies.
12#-------------------------------------------------------------------------
13
14
15bind Movie <Right> {
16    if {[%W ispanoramic]} {
17	%W pan [expr [%W pan] - 10]
18    } else {
19	%W step 1
20    }
21}
22bind Movie <Left> {
23    if {[%W ispanoramic]} {
24	%W pan [expr [%W pan] + 10]
25    } else {
26	%W step -1
27    }
28}
29bind Movie <Up> {
30    if {[%W ispanoramic]} {
31	%W tilt [expr [%W tilt] + 10]
32    } else {
33	set vol [expr 64 + [%W cget -volume]]
34	if {$vol > 255} {set vol 255}
35	%W configure -volume $vol
36    }
37}
38bind Movie <Down> {
39    if {[%W ispanoramic]} {
40	%W tilt [expr [%W tilt] - 10]
41    } else {
42	set vol [expr -64 + [%W cget -volume]]
43	if {$vol < 0} {set vol 0}
44	%W configure -volume $vol
45    }
46}
47bind Movie <Shift_L> {
48    if {[%W ispanoramic]} {
49	%W fieldofview [expr [%W fieldofview] - 5]
50    }
51}
52bind Movie <Control_L> {
53    if {[%W ispanoramic]} {
54	%W fieldofview [expr [%W fieldofview] + 5]
55    }
56}
57bind Movie <space> {
58    if {![%W ispanoramic]} {
59	if {[%W rate] == 0} {
60	    %W play
61	} else {
62	    %W stop
63	}
64    }
65}
66bind Movie <Button-1> {
67    focus %W
68}
69
70