codefrau / SqueakJS

A Squeak Smalltalk VM in Javascript
https://squeak.js.org
MIT License
365 stars 75 forks source link

Inputs not working on Pharo 7 #86

Closed pavel-krivanek closed 6 years ago

pavel-krivanek commented 6 years ago

Pharo on vanilla SqueakJS has no active inputs. The image is not responsive to events. The Craig's version does some changes to the method primitiveInputSemaphore:

    primitiveInputSemaphore: function(argCount) {
        var semaIndex = this.stackInteger(0);
        if (!this.success) return false;
        this.inputEventSemaIndex = semaIndex;
        window.interpreter = this;
        this.display.signalInputEvent = function() {
            this.signalSemaphoreWithIndex(this.inputEventSemaIndex);
        }.bind(this);
        this.display.signalInputEvent();
        return true;
    },

The problem is that in recordMouseEvent, the eventQueue is not set and so signalInputEvent is never executed

codefrau commented 6 years ago

Thanks for the PR! Merged.