----boundary-LibPST-iamunique-328888169_-_-
Content-type: text/plain
Rex,
You are asking two questions
(1) How does the BB framework get a keystroke
and
(2)Given that it has a keystroke how do I get that keystroke.
I claim it really doesn't matter what BB is doing behind the scenes.
All you want is the keystroke when a key is struck (asynchronously).
You really don't want a loop that waits but rather a signal (in the form
of a procedure call) that tells you here is the keystroke.
The background tasking of BB runs at 20 times a second so you can
easily nudge around graphical images each time a key is struck.
Why do you even care what BB is doing?
-Doug
On 3/29/2011 3:33 PM, Rex Couture wrote:
At 04:35 PM 3/29/2011, you wrote:
The principles behind ReadKey are in complete opposition to the principles
that Oberon (& BB) operate on. Oberon and BB operate on an event-driven
model in which the code that we write is expected to provide handlers that
the event loop calls in response to an event. In this sense they are always
'waiting for' a keystroke or similar event. In other words, it's
asynchronous, like an interrupt handler. You should not be writing code to
read directly from the keyboard.
I see. That's fine. I don't really care how one gets the keystroke, but there must be a simple way of reading keys. BB reads keystrokes SOMEHOW (I don't know, maybe it's complicated). Is there a SIMPLE way of handling the following three cases, for example?
1. REPEAT
(* I don't know how long this loop will take. If it takes a month, I might want to
interrupt it *)
UNTIL something happens (* message from windows that a key is pressed? *)
2. I'm doing a delicate visual, graphical manipulation and I want to nudge an image around with keystrokes.
3. Suppose you want to write a specialized editor. You need to read a keystroke and (optionally) display it. How does the BB environment read a keystroke?
Any hints?
Rex Couture
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
----boundary-LibPST-iamunique-328888169_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbWh0bWwxIFxkZWZmMHtcZm9udHRibA0Ke1xmMFxm
c3dpc3MgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJcZm5pbFxmY2hh
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