Steam Screenshot Arrow and Wheel Controls

Allows you to use the arrow keys to switch screenshots.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Steam Screenshot Arrow and Wheel Controls
// @namespace   Steam Screenshot Arrow and Wheel Controls
// @description Allows you to use the arrow keys to switch screenshots.
// @author      kriscross07
// @include     *.steampowered.com/app/*
// @include     *steamcommunity.com/sharedfiles/filedetails/*
// @version     1
// @run-at      document-start
// @grant       none
// ==/UserScript==

addEventListener('DOMContentLoaded',function(){
  $('#highlight_strip').addEventListener('wheel',function(e){
    e.preventDefault();
    e.deltaY<0&&prev();
    e.deltaY>0&&next();
  });
  addEventListener('keydown',function(e){
    e.which==37&&prev(),e.preventDefault();
    e.which==39&&next(),e.preventDefault();
  });
  
  function $(selector){
    if(!selector)return null;
    if(selector.charAt(0)=='#')return document.querySelector(selector);
    else return document.querySelectorAll(selector);
  }
  function next(){
    $('.focus')[0].nextSibling.nextSibling&&$('.focus')[0].nextSibling.nextSibling.click();
  }
  function prev(){
    $('.focus')[0].previousSibling.previousSibling&&$('.focus')[0].previousSibling.previousSibling.click();
  }
});