Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/471.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 检测HTML中的Wii U按钮输入_Javascript_Html_Button_Input_Wii U - Fatal编程技术网

Javascript 检测HTML中的Wii U按钮输入

Javascript 检测HTML中的Wii U按钮输入,javascript,html,button,input,wii-u,Javascript,Html,Button,Input,Wii U,我想让一个网站检测Wii U游戏板上的按钮输入。当我按下按钮时,什么也没发生。在Wii U浏览器上。也。这是我的密码: function reset() { var A = document.getElementById("A"); A.style.color = "black"; } if (navigator.appVersion.indexOf("WiiU") != -1) { // = WiiU Browser var A = document.getEleme

我想让一个网站检测Wii U游戏板上的按钮输入。当我按下按钮时,什么也没发生。在Wii U浏览器上。也。这是我的密码:

function reset() {
    var A = document.getElementById("A");
    A.style.color = "black";
}

if (navigator.appVersion.indexOf("WiiU") != -1) { // = WiiU Browser
    var A = document.getElementById("A");

    // Register all values from GamePad.
    wiiu.gamepad.update();

    A.style.color = "black";

    if (wiiu.gamepad.hold == 0x00080000) // A
        A.style.color = "cyan";
}

谢谢

在意识到它不起作用之前,你写了所有的代码?好的,我压缩了代码。谢谢你的文章。清理了格式。根据文档,
A
0x00008000
,而你有
0x00080000
。看起来像是打字错误。