elan-language / LanguageAndIDE

Apache License 2.0
3 stars 1 forks source link

rename getKeystroke methods, and change from extensions on Graphics to freestanding system methods #849

Closed richardpawson closed 2 weeks ago

richardpawson commented 2 weeks ago

Press any key to continue... is a common requirement in early programming. Currently you need to write e.g.:

let k be inputString("Press Enter to continue")

which is awkward because:

So with this method you just write e.g.

print "Press any key to continue...`
call waitForAnyKey()

Additionally

2) rename the two getKeystroke... methods to getKey...

3) Change getKey and getKeyWithModifier from extension methods on GraphicsBase to freestanding system methods. (This means they will need to put the focus on the graphics element before looking at the buffer.

4) Ensure that the following works:

call waitForAnyKey()
let k be getKey()

i.e. the first one does not use up the key.