Open tyynetyyne opened 9 years ago
Thanks for trying the site! This may be a current limitation of the Whalesong compiler. I've crossfiled a bug.
However, it does seem that the cropping and full-screen in your program are rendered incorrectly by the site. @vishesh did you recently change this?
It looks ok to me (full screen and first view show all there is: one red circle and the editor).
FWIW I have a non-released (it's not finished) symbolic calculator written in Whalesong and there are no problems with entering capitals (just checked in Chrom on OS X).
/Jens Axel
2015-09-10 20:04 GMT+02:00 Stephen Chang notifications@github.com:
Thanks for trying the site! This may be a current limitation of the Whalesong compiler. I've crossfiled a bug.
However, it does seem that the cropping and full-screen in your program are rendered incorrectly by the site. @vishesh https://github.com/vishesh did you recently change this?
— Reply to this email directly or view it on GitHub https://github.com/vishesh/whalebin/issues/16#issuecomment-139329690.
Jens Axel Søgaard
I noticed the same thing (no Capital letters) happening in WeScheme while testing it with my editor code. Are you [Whalebin] using same key-input components with that project [WeScheme]?
Tiina writes:
I noticed the same thing happening in WeScheme. Are you using same components with that project?
I am using a standard text box. Nothing fancy. I have this in the html file:
Jens Axel Søgaard, July 2014
A Computer Algebra System running in the browser.
The system is written in Racket and compiled to JavaScript with
Whalesong.
And the code that reads from the text box "next-interaction":
https://gist.github.com/soegaard/3b56486777a2f5ff4834
/Jens Axel
2015-09-10 22:11 GMT+02:00 Tiina Partanen notifications@github.com:
I noticed the same thing happening in WeScheme. Are you using same components with that project?
— Reply to this email directly or view it on GitHub https://github.com/vishesh/whalebin/issues/16#issuecomment-139366311.
Jens Axel Søgaard
@stchang It may get rendered incorrectly for first second or two but should eventually rendered fine. I had issues myself, but my solution is a hack so it can break. Other issue right now is - when switching to fullscreen I'll have to click on the canvas again to gain focus.
Not sure which repo I should be leaving these comments on, but the issue relates to using keydown instead of keypress. A semi-reasonable solution is to use both. See this commit here, which fixes many (though not all) of the issues: https://github.com/bootstrapworld/wescheme2012/commit/68636f6243ef92d4ea076f635e0e5b4c49118c04
There's also a minor CSS issue that trips up whitespace: https://github.com/bootstrapworld/wescheme2012/commit/0c54c89f7017285dfe87a04c40823c213105bb91
As for handling non-ASCII characters, I believe we'll want to dispatch the event to a textarea, and then grab the resulting character from there.
You can see the (fixed) issue in WeScheme here: http://203.wescheme.appspot.com/view?publicId=asHRFj6amE Please type slowly, as there are timer issues that will result in dropped or duplicated keypresses. Whalesong's runtime should handle this a lot better.
@soegaard I couldn't compile this with whalesong. It complained about match. Do I need your whalesong-libs
package?
@schanzer Thanks for the tips. Agree we need to work together. We'll take a look at what wescheme does.
@stchang Did you try (require whalesong/lang/match)
?
@stchang The file is a part of a larger project (a whalesong version of https://github.com/soegaard/racket-cas ) which extends match with various match-expanders. I the current state of the code is sadly pretty, so it was just meant as an inspiration.
On top of that I think I was off-track - Tiina wants to
write an editor and needs to control what happens when keys are pressed and released. I simply made a text field and grabbed the value from it.
/Jens Axel
2015-09-11 18:03 GMT+02:00 Stephen Chang notifications@github.com:
https://gist.github.com/soegaard/3b56486777a2f5ff4834
@soegaard https://github.com/soegaard I couldn't compile this with whalesong. It complained about match. Do I need your whalesong-libs package?
@schanzer https://github.com/schanzer Thanks for the tips. Agree we need to work together. We'll take a look at what wescheme does.
— Reply to this email directly or view it on GitHub https://github.com/vishesh/whalebin/issues/16#issuecomment-139586187.
Jens Axel Søgaard
This bug is about how to get keyboard events correctly though JavaScript layer into the big-bang. Something in the integration layer is not quite right...
Hi Tiina,
It took a while to get what was going on - it's been a while since I used big-bang.
The key-event sends the name of the keys - not the letters produced. In other words both a and A sends an #\a. However to enter A the shift key is pressed so you will also receive an event that the shift key is pressed.
In short - key track of the state of the shift key.
/Jens Axel
2015-09-10 19:52 GMT+02:00 Tiina Partanen notifications@github.com:
I did a simple text editor using this site ( http://bigbang.ccs.neu.edu/get/Z3k2r) and noticed that big-bang is not detecting shift (or AltGr), so you cannot enter capital letters or special chars such as ! or @ Also scandinavian chars are not handled correctly (ö, ä, å) e.g. they show up in the editor as empty space. In addition the plus sign (+) from my (Finnish) keyboard gives « and minus sign (-) gives Ã. Also pressing "delete" enters spaces in the editor.
— Reply to this email directly or view it on GitHub https://github.com/vishesh/whalebin/issues/16.
Jens Axel Søgaard
I wrote this editor in DrRacket and there it works ok, getting all displayable chars without any extra detection of Shift (or AlrGr). Are you trying to be compliant with DrRacket? If yes, then big-bang should get #\A not #\a when Shift+a is pressed? I think @schanzer has figured out how to do this.
P.S. I wrote the editor in BSL, does it change anything?
Hi Tiina,
The goal is to have the same behavior in both Whalesong and DrRacket.
I obviously should have tried it in DrRacket. I based my answer on reading the manual:
http://docs.racket-lang.org/teachpack/2htdpuniverse.html?q=big-bang#%28tech._world._keyevent%29
It does not mention what happens what shift+a produces (and the standard key events in DrRacket produces both a keys and a list of modifier keys).
I'll file a bug report against the documentation of htdp.
/Jens Axel
2015-09-13 11:08 GMT+02:00 Tiina Partanen notifications@github.com:
I wrote this editor in DrRacket and there it works ok, getting all displayable chars without any extra detection of Shift (or AlrGr). Are you trying to be compliant with DrRacket? If yes, then big-bang should get #\A not #\a when Shift+a is pressed? I think @schanzer https://github.com/schanzer has figured out how to do this.
— Reply to this email directly or view it on GitHub https://github.com/vishesh/whalebin/issues/16#issuecomment-139855219.
Jens Axel Søgaard
It's horrifically messy in JS, but I was able to get things working as-expected. See https://github.com/bootstrapworld/wescheme2012/blob/7360c1f6d179bf059c513b3a0422b9d7dbed2f71/war-src/js/js-runtime/world/jsworld/jsworld.js#L876-L914 and https://github.com/bootstrapworld/wescheme2012/blob/7360c1f6d179bf059c513b3a0422b9d7dbed2f71/war-src/js/js-runtime/world/jsworld.js#L616-L629
Demo at http://203.wescheme.appspot.com/openEditor?publicId=JPYtFBf3KR
Update: A better fix has been implemented on WeScheme.org.
Cool. Is that merged in Whalesong too?
There's juuuust enough difference between whalesong and wescheme for this change to be nontrivial. It's been almost two years since I hacked on whalesong, so I'm hesitant to port my fixes to what is now a somewhat-unfamiliar codebase. You will likely be able to do the patching much faster than I. Relevant code is at:
I did a simple text editor using this site (http://bigbang.ccs.neu.edu/get/Z3k2r) and noticed that big-bang is not detecting shift (or AltGr), so you cannot enter capital letters or special chars such as ! or @ Also scandinavian chars are not handled correctly (ö, ä, å) e.g. they show up in the editor as empty space. In addition the plus sign (+) from my (Finnish) keyboard gives « and minus sign (-) gives Ã. Also pressing "delete" enters spaces in the editor.