Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!kodak!elmgate!jeh From: jeh@elmgate.UUCP (Ed J Hanway CUST) Newsgroups: comp.sys.amiga.tech Subject: Re: input device questions Message-ID: <1087@elmgate.UUCP> Date: 1 Jun 89 20:41:03 GMT References: <7271@etana.tut.fi> Reply-To: jeh@elmgate.UUCP (Ed J Hanway CUST) Organization: Eastman Kodak Company, Rochester, NY Lines: 40 In article <7271@etana.tut.fi> pl@kaarne.tut.fi (Lehtinen Pertti) writes: > > When using input.device some questions arise to me: > > - I can generate input events and send them to inputdevice ok, > but who put's QUALIFIERS on their place? > I don't like to sneak keyboard just to get them. The qualifier should be set in order to support shift-clicking. The method I use is to open keyboard.device, then issue KBD_READMATRIX like so: UBYTE keys[13]; kbd_ior->io_Command = KBD_READMATRIX; kbd_ior->io_Length = 13; /* SEE NOTE BELOW */ kbd_ior->io_Data = (APTR) keys; DoIO(kbd_ior); event.ie_Qualifier |= keys[12]; The bits in the keys[12] are conveniently in the same order as the qualifier bits. NOTE: 13 is the only length that works, although if that's documented anywhere, it's news to me. > - Should I generate correct timestamp to event? > Do I have to open timer device in order to get it? > You need to time stamp the events in order for double-clicking to work correctly. I use timer.device, but I think you could also call Intuition and get the same thing. This goes for general mouse events. If you have a specific need just to move the mouse under program control and you're not doing any clicking, then I think it's safe to forget about the time stamps and the qualifiers. -- Ed Hanway Eastman Kodak Company ...{cornell,rutgers}!rochester!kodak!elmgate!jeh