[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Highwire edit



Quoting p.slegg@scubadivers.co.uk:

Hi,

I asked about this ages ago and I haven't done much work on it.

I was trying to add Ctrl-left and Ctrl-right functions to the Highwire
form edit code. I thought this would be a fairly generic function and
there would be a source lib that could be used. Someone suggested
I look at QED sources.

I am just having a look and the QED code looks a bit easier to follow.
Would it be useful to extract this sort of code into a source lib ?
It could provide the usual text editing features insert, delete, cursor
movemement even highlighting and possibly copy&paste.

Maybe this has been done all ready ?

Peter


Sorry to reply to my own message.

I am comparing the QED code in tasten.c with the highwire form.c
and there are some similarities so I am going to improve the highwire
code by using some bits of QED. Hopefully they will start to converge.
The QED code does look better to me.

I am puzzled by something:

bool edit_key(TEXTP t_ptr, WINDOWP window, short kstate, short kreturn)
{
	unsigned short	nkey;
	unsigned char	ascii_code;
	bool		shift, ctrl, alt;

	/* Key konvertieren */
	nkey = gem_to_norm(kstate, kreturn);
	nkey &= ~(NKF_RESVD|NKF_SHIFT|NKF_CTRL|NKF_CAPS);
	ascii_code = nkey & 0x00FF;

I'm not a great user of C so I don't understand the purpose of the
last line. Is it not the same as:

	ascii_code = nkey;

Also, QED uses NK_CLRHOME, NK_UP, NK_DOWN etc. Are these defined in
a standard lib ?

Thanks,

Peter