Click Message Input on Right Arrow Key

This script focuses and clicks the "Message Input" button on the sidebar when the right arrow key is pressed.

Fra og med 13.09.2024. Se den nyeste version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Click Message Input on Right Arrow Key
// @namespace   https://greasyfork.org/en/users/1200587-trilla-g
// @match       *://*.kick.com/*
// @grant       none
// @version     2.1
// @license     MIT
// @author      Trilla_G
// @description This script focuses and clicks the "Message Input" button on the sidebar when the right arrow key is pressed.
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('keydown', function(event) {
        // Check if the right arrow key is pressed
        if (event.key === 'ArrowRight') {
            clickMessageInput();
        }
    });

    function clickMessageInput() {
        // Target the message input element
        let messageInputButton = document.querySelector('.editor-input');

        if (messageInputButton) {
            // Ensure the element is focused before clicking
            messageInputButton.focus();  // Focus the input field
            messageInputButton.click();  // Click the input field
        }
    }
})();