F10 now wired into custom code
[fanfix.git] / src / be / nikiroo / fanfix / reader / tui / TuiReaderMainWindow.java
index a2313775a2411299d44611a88da0877ea6c6daa7..18a1223bbe70ea49a2ce9b5bddc244b0fe6c1da8 100644 (file)
@@ -8,6 +8,7 @@ import jexer.TAction;
 import jexer.TFileOpenBox.Type;
 import jexer.TList;
 import jexer.TWindow;
+import jexer.event.TCommandEvent;
 import jexer.event.TMenuEvent;
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.MetaData;
@@ -162,6 +163,16 @@ class TuiReaderMainWindow extends TWindow {
                return String.format("%5s: %s", meta.getLuid(), meta.getTitle());
        }
 
+       @Override
+       public void onCommand(TCommandEvent command) {
+               if (command.getCmd().equals(TuiReaderApplication.CMD_EXIT)) {
+                       TuiReaderApplication.close(this);
+               } else {
+                       // Handle our own event if needed here
+                       super.onCommand(command);
+               }
+       }
+
        @Override
        public void onMenu(TMenuEvent menu) {
                MetaData meta = getSelectedMeta();