mirror of
				https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
				synced 2025-11-03 19:44:27 +00:00 
			
		
		
		
	basic image next and prev control with joystick
This commit is contained in:
		
							parent
							
								
									876da12599
								
							
						
					
					
						commit
						b921a52071
					
				@ -210,6 +210,19 @@ document.addEventListener("DOMContentLoaded", function() {
 | 
			
		||||
    modal.id = "lightboxModal";
 | 
			
		||||
    modal.tabIndex = 0
 | 
			
		||||
    modal.addEventListener('keydown', modalKeyHandler, true)
 | 
			
		||||
    window.addEventListener('gamepadconnected', (e) => {
 | 
			
		||||
        console.log("Gamepad connected!")
 | 
			
		||||
        const gamepad = e.gamepad;
 | 
			
		||||
        setInterval(() => {
 | 
			
		||||
            const xValue = gamepad.axes[0].toFixed(2);
 | 
			
		||||
            if (xValue < -0.3) {
 | 
			
		||||
                modalPrevImage();
 | 
			
		||||
            } else if (xValue > 0.3) {
 | 
			
		||||
                modalNextImage();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }, 350);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const modalControls = document.createElement('div')
 | 
			
		||||
    modalControls.className = 'modalControls gradio-container';
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user