File tree 2 files changed +35
-9
lines changed
2 files changed +35
-9
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,18 @@ const NEMO_PREVIEW_DBUS_PATH = '/org/nemo/Preview';
42
42
const NEMO_PREVIEW_DBUS_NAME = 'org.nemo.Preview' ;
43
43
44
44
const NemoPreviewIface = '<node> \
45
- <interface name="org.nemo.Preview"> \
46
- <method name="ShowFile"> \
47
- <arg type="s" direction="in" name="uri" /> \
48
- <arg type="i" direction="in" name="xid" /> \
49
- <arg type="b" direction="in" name="closeIfAlreadyShown" /> \
50
- </method> \
51
- <method name="Close"> \
52
- </method> \
53
- </interface> \
45
+ <interface name="org.nemo.Preview"> \
46
+ <method name="ShowFile"> \
47
+ <arg type="s" direction="in" name="uri" /> \
48
+ <arg type="i" direction="in" name="xid" /> \
49
+ <arg type="b" direction="in" name="closeIfAlreadyShown" /> \
50
+ </method> \
51
+ <method name="Close"> \
52
+ </method> \
53
+ <signal name="SelectionEvent"> \
54
+ <arg type="q" name="direction" /> \
55
+ </signal> \
56
+ </interface> \
54
57
</node>' ;
55
58
56
59
var Application = new Lang . Class ( {
@@ -105,5 +108,12 @@ var Application = new Lang.Class({
105
108
}
106
109
this . _mainWindow . setParent ( xid ) ;
107
110
this . _mainWindow . setFile ( file ) ;
111
+ } ,
112
+
113
+ emitSelectionEvent ( direction ) {
114
+ this . _dbusImpl . emit_signal (
115
+ 'SelectionEvent' ,
116
+ new GLib . Variant ( '(u)' , [ direction ] )
117
+ ) ;
108
118
}
109
119
} ) ;
Original file line number Diff line number Diff line change @@ -200,6 +200,22 @@ MainWindow.prototype = {
200
200
key == Gdk . KEY_F11 )
201
201
this . toggleFullScreen ( ) ;
202
202
203
+ if ( key == 65364 /* Gdk.KEY_Down */ ) {
204
+ log ( 'down ' + Gtk . DirectionType . DOWN ) ;
205
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . DOWN ) ;
206
+ }
207
+ else if ( key == 65362 ) {
208
+ log ( 'up ' + Gtk . DirectionType . UP ) ;
209
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . UP ) ;
210
+ }
211
+ else if ( key == 65361 ) {
212
+ log ( 'left ' + Gtk . DirectionType . LEFT ) ;
213
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . LEFT ) ;
214
+ }
215
+ else if ( key == 65363 ) {
216
+ log ( 'right ' + Gtk . DirectionType . RIGHT ) ;
217
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . RIGHT ) ;
218
+ }
203
219
return false ;
204
220
} ,
205
221
You can’t perform that action at this time.
0 commit comments