Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TouchStart event to show key was pressed on touchscreen is not working #3

Open
karpawar opened this issue Dec 19, 2018 · 1 comment

Comments

@karpawar
Copy link

Hover class over they keyboard keys works fine as it shows
hover & which key was clicked
But in case of touchscreen : hover class dose not work.!!
are there any class to override style of key press with touch. ??
help appreciated

@karpawar
Copy link
Author

So i Fixed this with updating the client.js file to add class on <span class="key">
on same method which has touchstart & touchend

snippet from client.js which i modified

        `this.$container
            .on("mousedown touchstart", function(e) {
                if (!base._onMouseDown && $(e.target).data('kb-key') ) {
                    base._onMouseDown = true;
                    base.simKeyDown(e.target);
                    console.log('key pressed',e.target)
                    $(e.target).css('background', 'lightcyan');
                    e.stopImmediatePropagation();
                    return false;
                }
            });`

       ` $('body')
            .on("mouseup touchend", function(e) {
                if ( base._onMouseDown) {
                    console.log("up: ", e);
                    base._onMouseDown = false;
                    $(e.target).css('background', 'white');
                    base.simKeyUp(e.target);
                }
            });`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant