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';
4242const NEMO_PREVIEW_DBUS_NAME = 'org.nemo.Preview' ;
4343
4444const 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> \
5457</node>' ;
5558
5659var Application = new Lang . Class ( {
@@ -105,5 +108,12 @@ var Application = new Lang.Class({
105108 }
106109 this . _mainWindow . setParent ( xid ) ;
107110 this . _mainWindow . setFile ( file ) ;
111+ } ,
112+
113+ emitSelectionEvent ( direction ) {
114+ this . _dbusImpl . emit_signal (
115+ 'SelectionEvent' ,
116+ new GLib . Variant ( '(u)' , [ direction ] )
117+ ) ;
108118 }
109119} ) ;
Original file line number Diff line number Diff line change @@ -200,6 +200,19 @@ MainWindow.prototype = {
200200 key == Gdk . KEY_F11 )
201201 this . toggleFullScreen ( ) ;
202202
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+
203216 return false ;
204217 } ,
205218
You can’t perform that action at this time.
0 commit comments