DigiThinkIT / electron-virtual-keyboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

karpawar opened this issue · comments

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

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);
                }
            });`