coco

coco网站自定义快捷键

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         coco
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  coco网站自定义快捷键
// @author       Khz
// @match        https://www.cocomanhua.com/*
// @icon         https://www.google.com/s2/favicons?domain=google.com
// @grant        none
// ==/UserScript==


(function() {
    'use strict';
    // debugger;
    console.warn('==================================');
    /*
    var key = document.body;
    key.onkeydown =f;  //注册keydown事件处理函数
    key.onkeyup = f;  //注册keyup事件处理函数
    key.onkeypress = f;  //注册keypress事件处理函数
    function f (e) {
        var e = e || window.event;  //标准化事件处理
        var s = e.type + " " + e.keyCode;  //获取键盘事件类型和按下的值
        key.value = s;
    }*/
    document.body.onkeyup = function (e) {
        e = e || window.event; //标准化事件处理
        var s = e.type + " " + e.keyCode; //获取键盘事件类型和按下的值
        console.log(e);
        switch(e.keyCode){ // 获取当前按下键盘键的编码
            case 37 : // 按下左箭头键,向左移动5个像素
                // location.href = location.href;
                $('.mh_prevbook')[0].click()
                break;
            case 39 : // 按下右箭头键,向右移动5个像素
                $('.mh_prevbook')[1].click()
                break;
            case 38 : // 按下上箭头键,向上移动5个像素
                 //box.style.top = box.offsetTop  - 5 + "px";
                break;
            case 40 : // 按下下箭头键,向下移动5个像素
                 //box.style.top = box.offsetTop  + 5 + "px";
                break;
        }
        return false
    }

    // Your code here...
})();