f



Key up/down

In a Multi tasking program - it's possible to read a key pressed - but 
is there a method of receiving a key up?

As in say - using the down key as a morse key - to play a sample while 
pressed - and stop when the key is lifted.

Thanks
-- 
Colin Ferris Cornwall UK
0
cferris
10/14/2016 10:18:20 AM
comp.sys.acorn.programmer 2499 articles. 0 followers. Post Follow

5 Replies
261 Views

Similar Articles

[PageSpeed] 32

On 14/10/16 11:18, cferris@freeRemoveuk.com.invalid wrote:

> In a Multi tasking program - it's possible to read a key pressed - but
> is there a method of receiving a key up?

> As in say - using the down key as a morse key - to play a sample while
> pressed - and stop when the key is lifted.

Once you have detected a key has been pressed, try scanning specifically 
for that key until you detect that it's *not* being pressed.

OS_Byte, with R0 set to 121 and R1 set to the scan code for the key, 
with bit 7 set (i.e. exclusive or the scan code with &80).

-- 
Vince M Hudd
Soft Rock Software
0
Vince
10/14/2016 11:15:15 AM
On Friday, October 14, 2016 at 11:19:13 PM UTC+13, cfe...@freeremoveuk.com.=
invalid wrote:
> In a Multi tasking program - it's possible to read a key pressed - but=20
> is there a method of receiving a key up?

The main solution I've seen used is to write a module which claims the key =
pressed event and write the key code and up/down flag to a buffer. That buf=
fer is then read by your multitasking program with SWI calls. I've done thi=
s with limited success so it does work, but I never got around to polishing=
 it up and doing much with it.
0
mjfoot
10/16/2016 11:05:05 PM
In message <2c0ff16d-448b-41de-a4d6-fa004b73cfb9@googlegroups.com>
          mjfoot@paradise.net.nz wrote:

> On Friday, October 14, 2016 at 11:19:13 PM UTC+13,
> cfe...@freeremoveuk.com.invalid wrote:
>> In a Multi tasking program - it's possible to read a key pressed - but
>> is there a method of receiving a key up?

> The main solution I've seen used is to write a module which claims the
> key pressed event and write the key code and up/down flag to a buffer.
> That buffer is then read by your multitasking program with SWI calls.
> I've done this with limited success so it does work, but I never got
> around to polishing it up and doing much with it.

Thanks for these ideas.
Is it possible to look at your module.

In a module - perhaps catch the key-down - start the sample.
swi sound etc

catch the key-up - stop the sample.

*****
Would it be possible to add a key-up event to the Wimp.
Is the Wimp fast enough to respond - to Morse - without stuttering?
(Building in a way of decoding Morse to chars)

Hmm
-- 
Colin Ferris Cornwall UK
0
cferris
10/17/2016 9:46:13 AM
In article <2c0ff16d-448b-41de-a4d6-fa004b73cfb9@googlegroups.com>,
   <mjfoot@paradise.net.nz> wrote:
> On Friday, October 14, 2016 at 11:19:13 PM UTC+13, cfe...@freeremoveuk.com.invalid wrote:
> > In a Multi tasking program - it's possible to read a key pressed - but 
> > is there a method of receiving a key up?

> The main solution I've seen used is to write a module which claims
> the key pressed event and write the key code and up/down flag to a
> buffer. That buffer is then read by your multitasking program with
> SWI calls. I've done this with limited success so it does work, but
> I never got around to polishing it up and doing much with it.

Yes. That is what Snapper does to read the hot key combination that
triggers the snap.

-- 
Chris Johnson
0
News
10/17/2016 4:23:00 PM
On Monday, October 17, 2016 at 11:46:29 PM UTC+13, cfe...@freeremoveuk.com.invalid wrote:
> > The main solution I've seen used is to write a module which claims the
> > key pressed event and write the key code and up/down flag to a buffer.
> > That buffer is then read by your multitasking program with SWI calls.
> > I've done this with limited success so it does work, but I never got
> > around to polishing it up and doing much with it.
> 
> Thanks for these ideas.
> Is it possible to look at your module.

Send me an email and I can send you back my code to do this.
Contact details are here: http://homepages.paradise.net.nz/mjfoot/

0
mjfoot
10/17/2016 10:26:01 PM
Reply: