File tree Expand file tree Collapse file tree 2 files changed +32
-9
lines changed Expand file tree Collapse file tree 2 files changed +32
-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,19 @@ MainWindow.prototype = {
200
200
key == Gdk . KEY_F11 )
201
201
this . toggleFullScreen ( ) ;
202
202
203
+ if ( key == Gdk . KEY_Down ) {
204
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . DOWN ) ;
205
+ }
206
+ else if ( key == Gdk . KEY_Up ) {
207
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . UP ) ;
208
+ }
209
+ else if ( key == Gdk . KEY_Left ) {
210
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . LEFT ) ;
211
+ }
212
+ else if ( key == Gdk . KEY_Right ) {
213
+ this . _application . emitSelectionEvent ( Gtk . DirectionType . RIGHT ) ;
214
+ }
215
+
203
216
return false ;
204
217
} ,
205
218
You can’t perform that action at this time.
0 commit comments