1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-27 02:02:26 +00:00

Crude keyboard support for System 7 editboxes.

[originally from svn r3026]
This commit is contained in:
Ben Harris 2003-03-30 00:45:00 +00:00
parent 3ee06b8cc3
commit 82502df284

View File

@ -1,4 +1,4 @@
/* $Id: macctrls.c,v 1.21 2003/03/29 23:07:55 ben Exp $ */ /* $Id: macctrls.c,v 1.22 2003/03/30 00:45:00 ben Exp $ */
/* /*
* Copyright (c) 2003 Ben Harris * Copyright (c) 2003 Ben Harris
* All rights reserved. * All rights reserved.
@ -235,7 +235,7 @@ void macctrl_layoutbox(struct controlbox *cb, WindowPtr window,
} }
macctrl_layoutset(&curstate, cb->ctrlsets[i], window, mcs); macctrl_layoutset(&curstate, cb->ctrlsets[i], window, mcs);
} }
macctrl_switchtopanel(mcs, 2); macctrl_switchtopanel(mcs, 14);
/* 14 = proxies, 20 = SSH bugs */ /* 14 = proxies, 20 = SSH bugs */
} }
@ -906,13 +906,24 @@ void macctrl_key(WindowPtr window, EventRecord *event)
ControlRef control; ControlRef control;
struct macctrls *mcs = mac_winctrls(window); struct macctrls *mcs = mac_winctrls(window);
union macctrl *mc; union macctrl *mc;
TEHandle te;
if (mac_gestalts.apprvers >= 0x100 && if (mac_gestalts.apprvers >= 0x100) {
GetKeyboardFocus(window, &control) == noErr && control != NULL) { if (GetKeyboardFocus(window, &control) == noErr && control != NULL) {
HandleControlKey(control, (event->message & keyCodeMask) >> 8, HandleControlKey(control, (event->message & keyCodeMask) >> 8,
event->message & charCodeMask, event->modifiers); event->message & charCodeMask, event->modifiers);
mc = (union macctrl *)GetControlReference(control); mc = (union macctrl *)GetControlReference(control);
ctrlevent(mcs, mc, EVENT_VALCHANGE); ctrlevent(mcs, mc, EVENT_VALCHANGE);
}
} else {
if (mcs->focus != NULL) {
switch (mcs->focus->generic.type) {
case MACCTRL_EDITBOX:
te = (TEHandle)(*mcs->focus->editbox.tbctrl)->contrlData;
TEKey(event->message & charCodeMask, te);
break;
}
}
} }
} }