- Timestamp:
- 09/04/2017 03:04:49 PM (7 years ago)
- Branches:
- master
- Children:
- fffab34
- Parents:
- 4ed9bfe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/kbd.c
r4ed9bfe rd021bbb 91 91 } 92 92 93 #if defined NOT_YET94 93 static void key_touch(int32_t sig, int32_t val) 95 94 { … … 105 104 } 106 105 106 #if defined NOT_YET 107 107 static void pot_128(int32_t sig, int32_t val) 108 108 { … … 121 121 void kbd_key(SDL_KeyboardEvent *ev) 122 122 { 123 (void)ev; 123 static bool on[24]; 124 125 if ((ev->keysym.mod & KMOD_SHIFT) != 0 && 126 ev->keysym.sym >= SDLK_a && ev->keysym.sym <= SDLK_x) { 127 int32_t i = ev->keysym.sym - SDLK_a; 128 on[i] = !on[i]; 129 130 if (on[i]) { 131 key_touch(1 + i, 0x7f); 132 } 133 else { 134 key_off(1 + i); 135 } 136 137 ver2("kbd key %d %s", i, on[i] ? "on" : "off"); 138 } 124 139 } 125 140 … … 128 143 for (int32_t i = 0; ev->text[i] != 0; ++i) { 129 144 if (ev->text[i] >= '0' && ev->text[i] <= '9') { 145 ver2("kbd dat %c", ev->text[i]); 130 146 int32_t sig = 60 + ev->text[i] - '0'; 131 147 but_on(sig); … … 136 152 switch (ev->text[i]) { 137 153 case 'x': 154 ver2("kbd x"); 138 155 but_on(70); 139 156 but_off(70); … … 141 158 142 159 case 'e': 160 ver2("kbd e"); 143 161 but_on(71); 144 162 but_off(71); … … 146 164 147 165 case 'm': 166 ver2("kbd m"); 148 167 but_on(72); 149 168 but_off(72);
Note:
See TracChangeset
for help on using the changeset viewer.