Query on improving accessibility of ChatBot - How to open the chat bot using a particular key from the keyboard

I’m looking for a solution to open the chat bot using a particular key from the keyboard. I need have a custom Web/SDK code implementation where the chat bot opens on pressing the key on keyboard (ex: spacebar or enter).

Kindly suggest/help.

@priya.mandal
Kore.ai webSDK is a JS and JQuery library. So if you simply google how to perform some action on a web page on key press, you should get the answer. All I am trying to say here is that the solution here is not Kore.ai platform specific.

I will share some code with you which may help you. Basically, based on a ‘keyup’ or event listener configured, one needs to click the minimized chat window (use an identifier - the id or class of the chat button - and click)

Disclaimer - This is an openly available code and is just an example. Kore does not recommend this code or provide any warranty for using this on your production code. The user/developer needs to take a call on the context you want to use this code or example. You can extend this to your custom needs.

In kore-main.js, after$(document).ready(function () function if you write this code -

    $(document).keyup(function (event) {
        if (event.key == "Enter") {
            //trigger chat icon click
            $('.kore-chat-window .minimized').trigger('click');
        }
    });

Or the below for combination keys (Shift + B) [Refer to this for more details]

    window.addEventListener('keydown', function (event) {
        if (event.shiftKey && event.code === 'KeyB') {
            $('.kore-chat-window .minimized').trigger('click');
        }
    });

Now when you open the bot index.html, based on the key press you have configured in your code, you can invoke the chat window now.

Credits: @rajasekhar.balla