-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHotkey.cc
More file actions
77 lines (64 loc) · 1.69 KB
/
Hotkey.cc
File metadata and controls
77 lines (64 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "dirt.h"
#include "Hotkey.h"
#include "InputBox.h"
#include "TTY.h"
#include "ScrollbackSearch.h"
#include "Interpreter.h"
#include "Session.h"
#include "Chat.h"
#include "OutputWindow.h"
#include "StatusLine.h"
Hotkey *hotkey;
extern bool dirtFinished;
bool Hotkey::keypress (int key)
{
switch (key)
{
case key_alt_q: // Quit
dirtFinished = true;
break;
case key_alt_r:
interpreter.dirtCommand("reopen");
break;
case key_alt_v:
outputWindow->printVersion();
break;
case key_alt_s:
if (!currentSession)
status->setf ("No active session");
else
currentSession->show_nsw();
break;
case key_alt_o:
(void) new MUDSelection(screen);
break;
case key_ctrl_t:
if (!currentSession)
status->setf ("No active session");
else
currentSession->show_timer();
break;
// case key_alt_c: // FIXME doesn't work?
// interpreter.dirtCommand("close");
// break;
case key_alt_c:
if (!chatServerSocket)
status->setf("CHAT is not active. Set chat.name option in the config file");
else
(void) new ChatWindow(screen);
break;
case key_alt_slash:
(void) new ScrollbackSearch(false);
break;
// Enter scrollback
case key_page_up:
case key_home:
case key_pause:
outputWindow->getsb()->keypress(key);
// (new ScrollbackController(screen, outputWindow))->keypress(key);
break;
default:
return false;
}
return true;
}