Hi all.<br><br>I&#39;m writing my own EventSensor class (as part of Subcanvas: <a href="http://gulik.pbwiki.com/Canvas">http://gulik.pbwiki.com/Canvas</a>) and I&#39;m looking at what the VM is doing.<br><br>When I press and release key under a recent Linux VM, I get three events:<br>
<br>#(2 512613 53 1 8 0 0 0)<br>#(2 512613 53 0 8 0 0 0)<br>#(2 512664 53 2 8 0 0 0)<br clear="all"><br>The fields are (for those that don&#39;t already know this):<br><br>1: type (2=keyboard), <br>2: timestamp, <br>3: character in Mac Roman encoding, <br>
4: key press/release (0=character, 1=press, 2=release)<br>5: modifiers (1=shift, 2=ctrl, 4=mac option, 8=cmd/alt)<br><br>and the rest of the fields are unused afaict.<br><br>Now, why do I get both a key pressed event and a character event? The key pressed event already has the character information. Is there a circumstance where these two events would differ in anything other than the type of event? <br>
<br>The VM doesn&#39;t send any events for only a shift/ctrl/alt key press or release. Should it?<br><br>If you hold down a key, you get a stream of key press and character events for the same key. Should it? I&#39;d prefer to have character repetition handled within the image so that arcade games could be implemented.<br>
<br>Finally, I&#39;m lazy, so I&#39;m going to ask this mailing list how Unicode input has been handled rather than read code. Do implementations modify the VM to send Unicode characters through as field 3 (or whatever) of the input arrays? Or do the implementations take the Mac Roman encoding from the event array, look up a keyboard mapping in the image and convert the result to the correct Unicode character?<br>
<br>Gulik.<br><br>-- <br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a><br>