Re: [BLACKBOX] Program freezes when window loses focus

From: [at]} <Bob>
Date: Wed, 30 Mar 2011 22:31:55 +0100

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

> 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.

No, not really.

> BB reads
> keystrokes SOMEHOW (I don't know, maybe it's complicated).

In the Kernel module there's a process called KeyboardWatcher which appears
to capture Window keyboard events (key press, key release) but I haven't
studied it and I can't see what it does with the key at a quick glance, but
you might want to study that. However I think you'd be better off
understanding the principles underlying BB and working within its model
rather than fighting against it.
 
> 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?
> *)

I wouldn't do that with a keystroke. I'd use a button in a dialog and get it
to set a variable that the loop checks periodically.

>
> 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?
>

For your 2nd & 3rd examples you need to use a model-viewer-controller
design. In Mossenbock's book "Object-Oriented Programming in Oberon-2" he
gives examples of a text editor and a graphics editor. Although he's not
using Blackbox he does do a good job of explaining the principles that
underlie it, and that might help you understand why your questions are so
difficult to answer in an email.

> Rex Couture
>
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-418344073_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGF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CQiBlbnZpcm9ubWVudFxwYXINCj4gcmVhZCBhIGtleXN0cm9rZT9ccGFy
DQo+IFxwYXINCj4gICAgICAgICBBbnkgaGludHM/XHBhcg0KPiBccGFyDQpccGFyDQpGb3IgeW91
ciAybmQgJiAzcmQgZXhhbXBsZXMgeW91IG5lZWQgdG8gdXNlIGEgbW9kZWwtdmlld2VyLWNvbnRy
b2xsZXJccGFyDQpkZXNpZ24uIEluIE1vc3NlbmJvY2sncyBib29rICJPYmplY3QtT3JpZW50ZWQg
UHJvZ3JhbW1pbmcgaW4gT2Jlcm9uLTIiIGhlXHBhcg0KZ2l2ZXMgZXhhbXBsZXMgb2YgYSB0ZXh0
IGVkaXRvciBhbmQgYSBncmFwaGljcyBlZGl0b3IuIEFsdGhvdWdoIGhlJ3Mgbm90XHBhcg0KdXNp
bmcgQmxhY2tib3ggaGUgZG9lcyBkbyBhIGdvb2Qgam9iIG9mIGV4cGxhaW5pbmcgdGhlIHByaW5j
aXBsZXMgdGhhdFxwYXINCnVuZGVybGllIGl0LCBhbmQgdGhhdCBtaWdodCBoZWxwIHlvdSB1bmRl
cnN0YW5kIHdoeSB5b3VyIHF1ZXN0aW9ucyBhcmUgc29ccGFyDQpkaWZmaWN1bHQgdG8gYW5zd2Vy
IGluIGFuIGVtYWlsLlxwYXINClxwYXINCj4gUmV4IENvdXR1cmVccGFyDQo+IFxwYXINCj4gXHBh
cg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3
aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRvIExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSH19
AAABBQA=
----boundary-LibPST-iamunique-418344073_-_---
Received on Wed Mar 30 2011 - 23:31:55 UTC

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