Bert Freudenberg bert@isgnw.CS.Uni-Magdeburg.De wrote:
On Fri, 3 Dec 1999, Henrik Gedenryd wrote:
AFAIK, there is no way to get the current keyboard state for the regular alphanumeric keys, like you can for modifier keys and mouse buttons.
Is there any way to check whether eg. the key 'i' is pressed at the moment?
Nope. Only key-press events are forwarded to Squeak, key-release events are eaten by the VM.
If and when the low-level input system is looked at again, let's please look at this. By far most smalltalk programs won't care, but games are a notable exception that might be worth thinking about.
Lex
I agree. It would also be useful for interactive music applications.
Danny
At 09:57 AM 12/6/99 +0000, you wrote:
Bert Freudenberg bert@isgnw.CS.Uni-Magdeburg.De wrote:
On Fri, 3 Dec 1999, Henrik Gedenryd wrote:
AFAIK, there is no way to get the current keyboard state for the regular alphanumeric keys, like you can for modifier keys and mouse buttons.
Is there any way to check whether eg. the key 'i' is pressed at the
moment?
Nope. Only key-press events are forwarded to Squeak, key-release events are eaten by the VM.
If and when the low-level input system is looked at again, let's please look at this. By far most smalltalk programs won't care, but games are a notable exception that might be worth thinking about.
Lex
---
Dr. Daniel V. Oppenheim
Computer Music Center IBM T.J. Watson Research Center phone: (914) 945-1989 P. O. Box 218 (or Route 134) fax: (914) 945-3434 Yorktown Heights, NY 10598 www.research.ibm.com/music
Lex Spoon wrote:
Bert Freudenberg bert@isgnw.CS.Uni-Magdeburg.De wrote:
On Fri, 3 Dec 1999, Henrik Gedenryd wrote:
AFAIK, there is no way to get the current keyboard state for the regular alphanumeric keys, like you can for modifier keys and mouse buttons.
Is there any way to check whether eg. the key 'i' is pressed at the moment?
Nope. Only key-press events are forwarded to Squeak, key-release events are eaten by the VM.
If and when the low-level input system is looked at again, let's please look at this. By far most smalltalk programs won't care, but games are a notable exception that might be worth thinking about.
Lex
That's right, but supporting key-up events on all platforms is a porting nightmare. Some platforms simply don't provide them, or only provide some combinations and not others, etc. And you probably can't disable auto-repeat, or you get key-up events in the wrong order for modifiers, or the shift state is wrong for key-up events, ...
If you look at the platform event handling code in some commercial multi-platform Smalltalks (in the VM for VisualWorks, in the image for VisualAge) you see that it consists mostly of workarounds for awkward and undocumented platform behavior :-(
If you have control over the real low level stuff (like writing the drivers for mouse/keyboard), you can make it work quite nicely. But not if you're at the mercy of M$ or Apple or whoever wrote that ugly non-Smalltalk OS you have to use to get Squeak running.
Hans-Martin
squeak-dev@lists.squeakfoundation.org