1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// console.cpp: the console buffer, its display, and command line control
#include "cube.h"
#include <ctype.h>
#import "KeyMapping.h"
struct cline {
char *cref;
int outtime;
};
vector<cline> conlines;
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// console.cpp: the console buffer, its display, and command line control
#include "cube.h"
#include <ctype.h>
#import "KeyMapping.h"
#import "OFString+Cube.h"
struct cline {
char *cref;
int outtime;
};
vector<cline> conlines;
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
void
keymap(OFString *code, OFString *key, OFString *action)
{
if (keyMappings == nil)
keyMappings = [[OFMutableArray alloc] init];
KeyMapping *mapping = [[KeyMapping alloc] initWithCode:code.intValue
name:key];
mapping.action = action;
[keyMappings addObject:mapping];
}
COMMAND(keymap, ARG_3STR)
void
bindkey(OFString *key, OFString *action)
|
|
|
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
void
keymap(OFString *code, OFString *key, OFString *action)
{
if (keyMappings == nil)
keyMappings = [[OFMutableArray alloc] init];
KeyMapping *mapping =
[[KeyMapping alloc] initWithCode:code.cube_intValue name:key];
mapping.action = action;
[keyMappings addObject:mapping];
}
COMMAND(keymap, ARG_3STR)
void
bindkey(OFString *key, OFString *action)
|