Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!mcsun!ukc!edcastle!hwcs!neil From: neil@cs.hw.ac.uk (Neil Forsyth) Newsgroups: comp.sys.atari.st.tech Subject: Re: Simulating keypress Message-ID: <2695@odin.cs.hw.ac.uk> Date: 8 Apr 91 08:36:29 GMT References: <1991Apr5.151946.25763@etek.chalmers.se> <1991Apr6.000637.20676@jato.jpl.nasa.gov> Sender: news@cs.hw.ac.uk Reply-To: neil@cs.hw.ac.uk (Neil Forsyth) Organization: Computer Science, Heriot-Watt U., Scotland Lines: 32 In article <1991Apr6.000637.20676@jato.jpl.nasa.gov> vsnyder@jato.Jpl.Nasa.Gov (Van Snyder) writes: >I'd like to get hold of keypresses. It's easy to get hold of mouse >motions by inserting your own handler in place of the mousevec in >the struct returned by XBIOS' kbdvec function. But how do you get >hold of keypresses? Must you intercept the keyboard packet handler >and interpret all the packets? If you want to know if the key is up or down then I'm afraid the answer is yes. If you just want to catch the key (scancode and ascii) entering the keyboard buffer then intercept the ikbdsys vector with a routine that checks the buffer pointers before and after calling the original. If the buffer pointer has changed then a key just entered the buffer. One use of this is to program macros on the function keys. (ie. If F0 enteres buffer, remove it and place something else in there) >Thanks in advance, Your welcome in retreat. >vsnyder@jato.Jpl.Nasa.Gov >ames!elroy!jato!vsnyder >vsnyder@jato.uucp +----------------------------------------------------------------------------+ ! DISCLAIMER:Unless otherwise stated, the above comments are entirely my own ! ! ! ! Neil Forsyth JANET: neil@uk.ac.hw.cs ! ! Dept. of Computer Science ARPA: neil@cs.hw.ac.uk ! ! Heriot-Watt University UUCP: ..!ukc!cs.hw.ac.uk!neil ! ! Edinburgh, Scotland, UK "That was never 5 minutes!" ! +----------------------------------------------------------------------------+