Re: [BLACKBOX] Program freezes when window loses focus

From: [at]} <Rex>
Date: Tue, 29 Mar 2011 17:33:40 -0500

----boundary-LibPST-iamunique-1134381152_-_-
Content-type: text/plain

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----boundary-LibPST-iamunique-1134381152_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEF0IDA0OjM1IFBNIDMv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lZSBjYXNlcywgZm9yIGV4
YW1wbGU/XHBhcg0KXHBhcg0KMS4gIFJFUEVBVFxwYXINCiAgICAgICAgKCogSSBkb24ndCBrbm93
IGhvdyBsb25nIHRoaXMgbG9vcCB3aWxsIHRha2UuICBJZiBpdCB0YWtlcyBhIG1vbnRoLCBJIG1p
Z2h0IHdhbnQgdG9ccGFyDQogICAgICAgICAgICAgICAgaW50ZXJydXB0IGl0ICopXHBhcg0KVU5U
SUwgc29tZXRoaW5nIGhhcHBlbnMgKCogbWVzc2FnZSBmcm9tIHdpbmRvd3MgdGhhdCBhIGtleSBp
cyBwcmVzc2VkPyAqKVxwYXINClxwYXINCjIuIEknbSBkb2luZyBhIGRlbGljYXRlIHZpc3VhbCwg
Z3JhcGhpY2FsIG1hbmlwdWxhdGlvbiBhbmQgSSB3YW50IHRvIG51ZGdlIGFuIGltYWdlIGFyb3Vu
ZCB3aXRoIGtleXN0cm9rZXMuXHBhcg0KXHBhcg0KMy4gU3VwcG9zZSB5b3Ugd2FudCB0byB3cml0
ZSBhIHNwZWNpYWxpemVkIGVkaXRvci4gIFlvdSBuZWVkIHRvIHJlYWQgYSBrZXlzdHJva2UgYW5k
IChvcHRpb25hbGx5KSBkaXNwbGF5IGl0LiAgSG93IGRvZXMgdGhlIEJCIGVudmlyb25tZW50IHJl
YWQgYSBrZXlzdHJva2U/XHBhcg0KXHBhcg0KICAgICAgICBBbnkgaGludHM/XHBhcg0KXHBhcg0K
UmV4IENvdXR1cmUgXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBz
ZW5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJ
U1RTLk9CRVJPTi5DSH19AAAwAQA=
----boundary-LibPST-iamunique-1134381152_-_---
Received on Wed Mar 30 2011 - 00:33:40 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:16 UTC