gamepad repeat option
This commit is contained in:
parent
cca5782d18
commit
99f3bf07d2
|
@ -1,4 +1,3 @@
|
|||
const delay = 350//ms
|
||||
let isWaiting = false;
|
||||
window.addEventListener('gamepadconnected', (e) => {
|
||||
setInterval(async () => {
|
||||
|
@ -18,7 +17,7 @@ window.addEventListener('gamepadconnected', (e) => {
|
|||
if (xValue < 0.3 && xValue > -0.3) {
|
||||
return true;
|
||||
}
|
||||
}, delay);
|
||||
}, opts.js_modal_lightbox_gamepad_repeat);
|
||||
isWaiting = false;
|
||||
}
|
||||
}, 10);
|
||||
|
@ -41,7 +40,7 @@ window.addEventListener('wheel', (e) => {
|
|||
|
||||
setTimeout(() => {
|
||||
isScrolling = false;
|
||||
}, delay);
|
||||
}, opts.js_modal_lightbox_gamepad_repeat);
|
||||
});
|
||||
|
||||
function sleepUntil(f, timeout) {
|
||||
|
|
|
@ -400,6 +400,7 @@ options_templates.update(options_section(('ui', "User interface"), {
|
|||
"js_modal_lightbox": OptionInfo(True, "Enable full page image viewer"),
|
||||
"js_modal_lightbox_initially_zoomed": OptionInfo(True, "Show images zoomed in by default in full page image viewer"),
|
||||
"js_modal_lightbox_gamepad": OptionInfo(True, "Navigate image viewer with gamepad"),
|
||||
"js_modal_lightbox_gamepad_repeat": OptionInfo(250, "Gamepad repeat period, in milliseconds"),
|
||||
"show_progress_in_title": OptionInfo(True, "Show generation progress in window title."),
|
||||
"samplers_in_dropdown": OptionInfo(True, "Use dropdown for sampler selection instead of radio group"),
|
||||
"dimensions_and_batch_together": OptionInfo(True, "Show Width/Height and Batch sliders in same row"),
|
||||
|
|
Loading…
Reference in New Issue