From mint-bounce@lists.fishpool.fi Thu Jul 23 09:42:14 2009 Message-ID: <20090723143553.2tznvkixsgogosc8@pop.freeola.net> Date: Thu, 23 Jul 2009 14:35:53 +0100 From: p.slegg@scubadivers.co.uk To: mint@lists.fishpool.fi Subject: Re: [MiNT] Highwire edit References: <004817e1.019ad6d61bb6@smtp.freeola.net> <4A6421E4.4030706@freesbee.fr> <20090722143357.shzph6ag9w4840so@pop.freeola.net> In-Reply-To: <20090722143357.shzph6ag9w4840so@pop.freeola.net> MIME-Version: 1.0 Content-Type: text/plain; charset=; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: p.slegg@scubadivers.co.uk Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: 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