usim

Check-in [d9db9b2bd7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:sdl2.c: Map Top key...
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ams/sdl
Files: files | file ages | folders
SHA3-256: d9db9b2bd71fc9766a9c076c85933963e4d674f46f8e40b039da2f907c4a7717
User & Date: ams 2024-06-25 08:09:53
Context
2024-06-25
09:39
Move send_accumulated_updates and accumulate_update to tv.c. check-in: 8f1f5f72ee user: ams tags: ams/sdl
08:09
sdl2.c: Map Top key... check-in: d9db9b2bd7 user: ams tags: ams/sdl
08:09
cadet.c (cadet_process_shift): Make function slightly easier to follow. check-in: 06c22160c4 user: ams tags: ams/sdl
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to kbd.c.

222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
		modifier_map[i] = KBD_NoSymbol;

	/* *INDENT-OFF* */
	/*
	 * Initialize keyboard modifiers
	 */

	modifier_map[ShiftMapIndex] = KBD_SHIFT;
	modifier_map[LockMapIndex] = KBD_SHIFT_LOCK;
	modifier_map[ControlMapIndex] = KBD_CONTROL;
	modifier_map[Mod1MapIndex] = KBD_META;
	modifier_map[Mod2MapIndex] = KBD_NoSymbol;
	modifier_map[Mod3MapIndex] = KBD_NoSymbol;
	modifier_map[Mod4MapIndex] = KBD_TOP;
	modifier_map[Mod5MapIndex] = KBD_NoSymbol;

	/*
	 * Initialize keyboard mapping.
	 *
	 * We cann't reuse lmch.defs here because the Lisp Machine
	 * charachter set has names and charachters that do not have a
	 * corresponding mapping in X11.







|
|
|
|
|
|
|
|







222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
		modifier_map[i] = KBD_NoSymbol;

	/* *INDENT-OFF* */
	/*
	 * Initialize keyboard modifiers
	 */

	modifier_map[ShiftMapIndex] = KBD_SHIFT;     /* Shift */
	modifier_map[LockMapIndex] = KBD_SHIFT_LOCK; /* Caps Lock */
	modifier_map[ControlMapIndex] = KBD_CONTROL; /* Control */
	modifier_map[Mod1MapIndex] = KBD_META;	     /* Alt */
	modifier_map[Mod2MapIndex] = KBD_NoSymbol;   /* Num Lock */
	modifier_map[Mod3MapIndex] = KBD_NoSymbol;   /* ??? */
	modifier_map[Mod4MapIndex] = KBD_TOP;	     /* Super */
	modifier_map[Mod5MapIndex] = KBD_NoSymbol;   /* AltGR */

	/*
	 * Initialize keyboard mapping.
	 *
	 * We cann't reuse lmch.defs here because the Lisp Machine
	 * charachter set has names and charachters that do not have a
	 * corresponding mapping in X11.

Changes to sdl2.c.

203
204
205
206
207
208
209

210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
	state = SDL_GetKeyboardState(&statesize);
	for (int i = 0; allup && i < statesize; i++) {
		int bucky;

		if (state[i] != 1)
			continue; /* bucky not pressed */
		bucky = -1;

		switch (SDL_GetKeyFromScancode(i)) {
		case SDLK_LSHIFT: case SDLK_RSHIFT: bucky = modifier_map[ShiftMapIndex]; break;
		case SDLK_LCTRL: case SDLK_RCTRL: bucky = modifier_map[ControlMapIndex]; break;
		case SDLK_LALT: case SDLK_RALT: bucky = modifier_map[Mod1MapIndex]; break;
//		case SDLK_LMETA: case SDLK_RMETA: 
//		case SDLK_LSUPER: case SDLK_RSUPER: 
		case SDLK_MODE: bucky = modifier_map[Mod4MapIndex]; break;
		case SDLK_MENU: bucky = modifier_map[KBD_NoSymbol]; break;
//		case SDLK_COMPOSE: bucky = modifier_map[]; break;
		case SDLK_CAPSLOCK:bucky = modifier_map[ControlMapIndex]; break;
		}
		DEBUG(TRACE_KBD, "cadet_allup_key() - bucky pressed (%d), i = %d\n", bucky, i);
		cadet_press_bucky(bucky, &mods, &shifts);
	}
	if (allup == true) {
		DEBUG(TRACE_KBD, "cadet_allup_key() - all-up event; mods = 0%o, shifts = 0%o\n", mods, shifts);
		cadet_shifts = shifts;







>




|

|
|

|







203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
	state = SDL_GetKeyboardState(&statesize);
	for (int i = 0; allup && i < statesize; i++) {
		int bucky;

		if (state[i] != 1)
			continue; /* bucky not pressed */
		bucky = -1;
		// This needs to be cleaned up -- translates scancode to bucky xk/index
		switch (SDL_GetKeyFromScancode(i)) {
		case SDLK_LSHIFT: case SDLK_RSHIFT: bucky = modifier_map[ShiftMapIndex]; break;
		case SDLK_LCTRL: case SDLK_RCTRL: bucky = modifier_map[ControlMapIndex]; break;
		case SDLK_LALT: case SDLK_RALT: bucky = modifier_map[Mod1MapIndex]; break;
		case SDLK_LGUI: case SDLK_RGUI:  bucky = modifier_map[Mod4MapIndex]; break;
//		case SDLK_LSUPER: case SDLK_RSUPER: 
//		case SDLK_MODE: bucky = modifier_map[Mod5MapIndex]; break;
//		case SDLK_MENU: bucky = modifier_map[KBD_NoSymbol]; break;
//		case SDLK_COMPOSE: bucky = modifier_map[]; break;
		case SDLK_CAPSLOCK:bucky = modifier_map[LockMapIndex]; break;
		}
		DEBUG(TRACE_KBD, "cadet_allup_key() - bucky pressed (%d), i = %d\n", bucky, i);
		cadet_press_bucky(bucky, &mods, &shifts);
	}
	if (allup == true) {
		DEBUG(TRACE_KBD, "cadet_allup_key() - all-up event; mods = 0%o, shifts = 0%o\n", mods, shifts);
		cadet_shifts = shifts;