您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add keyboard navigation for Fetch!
// ==UserScript== // @name Grundos Cafe Fetch! Keyboard Controls // @namespace https://greasyfork.org/en/users/1291562-zarotrox // @version 0.1 // @description Add keyboard navigation for Fetch! // @author Zarotrox // @match https://www.grundos.cafe/games/fetch/* // @icon https://i.ibb.co/44SS6xZ/Zarotrox.png // @license MIT // ==/UserScript== (function() { 'use strict'; // Listen for keydown events document.addEventListener('keydown', function(event) { switch(event.key) { case "ArrowUp": var northArea = document.querySelector('area[onclick="goNorth()"]'); if (northArea) { goNorth(); // Trigger the goNorth function } break; case "ArrowDown": var southArea = document.querySelector('area[onclick="goSouth()"]'); if (southArea) { goSouth(); // Trigger the goSouth function } break; case "ArrowLeft": var westArea = document.querySelector('area[onclick="goWest()"]'); if (westArea) { goWest(); // Trigger the goWest function } break; case "ArrowRight": var eastArea = document.querySelector('area[onclick="goEast()"]'); if (eastArea) { goEast(); // Trigger the goEast function } break; } }); })();