hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.38k stars 2.19k forks source link

Default controls.ini currently makes touchpad 'analog stick' if there is no controller available #11139

Closed i30817 closed 3 years ago

i30817 commented 6 years ago

What happens?

Pretty much what's on the title. This is a 'problem' for people without controllers because they use the mouse to navigate the menus. Only, natch, some 'directions' of the touchpad serve to exit menus (didn't bother to check which). Which means every time they move the mouse to click on the buttons there is a chance to exit the submenu.

What should happen?

Dunno, maybe filter touchpad from 'analog' device candidates or don't apply them in the menu as mouse pointer controller and analog stick at the same time.

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

linux x86-64 Wayland ubuntu bionic.

i30817 commented 6 years ago

Bump. This is still happening, dragging the touchpad anywhere into the left side of a submenu is enough to get the submenu closed in ppsspp.

the console says this interesting thing:


loading control pad mappings from gamecontrollerdb.txt: SUCCESS!
Control pad device 0 not supported by SDL game controller database, attempting to create default mapping...
Added default mapping ok
found control pad: SynPS/2 Synaptics TouchPad, loading mapping: SUCCESS, mapping is:
110000000200000007000000b1010000,SynPS/2 Synaptics TouchPad,x:b3,a:b0,b:b1,y:b2,back:b8,guide:b10,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:a2,rightshoulder:b6,rightshoulder:b5,righttrigger:a5,leftstick:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a3,righty:a4
pad 1 has been assigned to control pad: SynPS/2 Synaptics TouchPad

I removed the 'auto assigned' mappings the the touchpad and things started working correctly, but the point such as it is, is that a touchpad should probably not be confused with a controller on first startup.

i30817 commented 6 years ago

Also something that's quite bad usability happens too:

F1 is the key to open the 'help' (this actually opens the browser and sends you to the site even if the browser is closed). Since this is right next to 'esc' which is used to open the menu and there appears to be no way to unmap this (unnecessary) shortcut, this is quite annoying.

unknownbrackets commented 6 years ago

Hm, I guess that's Qt specific? Windows doesn't do that on F1.

I guess we should remove the touchpad from the gamecontrollerdb?

-[Unknown]

i30817 commented 6 years ago

Yeah I doubt it happened before QT. I'm a bit clumsy and it never did before it became default.

edit: if you click on the help menu while windowed in linux you'll see two 'default' shortcuts, one for the official site (F1) and another for 'about ppsspp' (shift+F1).

i30817 commented 6 years ago

Oh, btw i've seen this happening in other applications too. I don't know if it's a sdl, qt, wx or gnome problem (i'm pretty confused about what fs-uae-launcher uses) but in that application it's pretty explicit - if you have any game config selected the default config for 'amiga joystick' if you don't have a controller yourself is 'Default (SynPS/2 Synaptics TouchPad)'.

Which sounds super wrong, and sure enough causes problems.

i30817 commented 5 years ago

So, this is still happening. It manifests on a newly downloaded buildbot build ( v1.7.5-403-g128c0ad ). Which is quite old, but its probably the youngest one if i don't want to build, which i don't. The ppa is abandoned.

To reproduce, i just click on 'settings' and move the mouse. Instant exit from 'settings' back into the main.

I probably should wait to see if https://github.com/hrydgard/ppsspp/pull/12173#event-2484057096 which was just merged changes the issue, but here are the config files anyway:

[ControlMapping]
Up = 1-19,10-19
Down = 1-20,10-20
Left = 1-21,10-21
Right = 1-22,10-22
Circle = 1-52,10-190
Cross = 1-54,10-189
Square = 1-29,10-191
Triangle = 1-47,10-188
Start = 1-62,10-197
Select = 1-66,10-196
L = 1-45,10-194
R = 1-51,10-195
An.Up = 1-37,10-4003
An.Down = 1-39,10-4002
An.Left = 1-38,10-4001
An.Right = 1-40,10-4000
Analog limiter = 1-60
RapidFire = 1-59
Unthrottle = 1-61
SpeedToggle = 1-68
Pause = 1-111
Rewind = 1-67

[General]
FirstRun = False
RunCount = 3
Enable Logging = True
AutoRun = True
Browse = False
IgnoreBadMemAccess = True
CurrentDirectory = /home/i30817/Downloads/
ShowDebuggerOnLoad = False
CheckForNewVersion = True
Language = en_US
ForceLagSync = False
DiscordPresence = True
NumWorkerThreads = 2
AutoLoadSaveState = 0
EnableCheats = False
CwCheatRefreshRate = 77
ScreenshotsAsPNG = False
UseFFV1 = False
DumpFrames = False
DumpAudio = False
SaveLoadResetsAVdumping = False
StateSlot = 0
EnableStateUndo = True
RewindFlipFrequency = 0
GridView1 = True
GridView2 = True
GridView3 = False
ComboMode = 0
ReportingHost = default
AutoSaveSymbolMap = False
CacheFullIsoInRam = False
RemoteISOPort = 0
LastRemoteISOServer = 
LastRemoteISOPort = 0
RemoteISOManualConfig = False
RemoteShareOnStartup = False
RemoteISOSubdir = /
RemoteDebuggerOnStartup = False
InternalScreenRotation = 1
PauseWhenMinimized = False
DumpDecryptedEboots = False
MemStickInserted = True
[CPU]
CPUCore = 1
SeparateSASThread = True
SeparateIOThread = True
IOTimingMethod = 0
FastMemoryAccess = True
FuncReplacements = True
HideSlowWarnings = False
HideStateWarnings = False
PreloadFunctions = False
JitDisableFlags = 0x00000000
CPUSpeed = 0
[Graphics]
EnableCardboard = False
CardboardScreenSize = 50
CardboardXShift = 0
CardboardYShift = 0
ShowFPSCounter = 0
GraphicsBackend = 0
FailedGraphicsBackends = 
VulkanDevice = 
RenderingMode = 1
SoftwareRenderer = False
HardwareTransform = True
SoftwareSkinning = True
TextureFiltering = 1
BufferFiltering = 1
InternalResolution = 1
AndroidHwScale = 1
HighQualityDepth = 1
FrameSkip = 0
FrameSkipType = 0
AutoFrameSkip = False
FrameRate = 0
FrameRate2 = -1
FrameSkipUnthrottle = True
ForceMaxEmulatedFPS = 60
AnisotropyLevel = 4
VertexDecCache = True
TextureBackoffCache = False
TextureSecondaryCache = False
FullScreen = False
FullScreenMulti = False
SmallDisplayZoomType = 2
SmallDisplayOffsetX = 0.500000
SmallDisplayOffsetY = 0.500000
SmallDisplayZoomLevel = 1.000000
ImmersiveMode = False
SustainedPerformanceMode = False
ReplaceTextures = True
SaveNewTextures = False
IgnoreTextureFilenames = True
TexScalingLevel = 1
TexScalingType = 0
TexDeposterize = False
VSyncInterval = False
BloomHack = 0
SplineBezierQuality = 2
HardwareTessellation = False
PostShader = Off
MemBlockTransferGPU = True
DisableSlowFramebufEffects = False
FragmentTestCache = True
LogFrameDrops = False
[Sound]
Enable = True
AudioBackend = 0
AudioLatency = 1
ExtraAudioBuffering = False
SoundSpeedHack = False
AudioResampler = True
GlobalVolume = 10
[Control]
HapticFeedback = False
ShowTouchCross = True
ShowTouchCircle = True
ShowTouchSquare = True
ShowTouchTriangle = True
ComboKey0Mapping = 0
ComboKey1Mapping = 0
ComboKey2Mapping = 0
ComboKey3Mapping = 0
ComboKey4Mapping = 0
ShowTouchPause = False
ShowTouchControls = False
DisableDpadDiagonals = False
GamepadOnlyFocused = False
TouchButtonStyle = 1
TouchButtonOpacity = 65
TouchButtonHideSeconds = 20
AutoCenterTouchAnalog = False
ActionButtonSpacing2 = 1.000000
ActionButtonCenterX = -1.000000
ActionButtonCenterY = -1.000000
ActionButtonScale = 1.150000
DPadX = -1.000000
DPadY = -1.000000
DPadScale = 1.150000
ShowTouchDpad = True
DPadSpacing = 1.000000
StartKeyX = -1.000000
StartKeyY = -1.000000
StartKeyScale = 1.150000
ShowTouchStart = True
SelectKeyX = -1.000000
SelectKeyY = -1.000000
SelectKeyScale = 1.150000
ShowTouchSelect = True
UnthrottleKeyX = -1.000000
UnthrottleKeyY = -1.000000
UnthrottleKeyScale = 1.150000
ShowTouchUnthrottle = True
LKeyX = -1.000000
LKeyY = -1.000000
LKeyScale = 1.150000
ShowTouchLTrigger = True
RKeyX = -1.000000
RKeyY = -1.000000
RKeyScale = 1.150000
ShowTouchRTrigger = True
AnalogStickX = -1.000000
AnalogStickY = -1.000000
AnalogStickScale = 1.150000
ShowAnalogStick = True
fcombo0X = -1.000000
fcombo0Y = -1.000000
comboKeyScale0 = 1.150000
ShowComboKey0 = False
fcombo1X = -1.000000
fcombo1Y = -1.000000
comboKeyScale1 = 1.150000
ShowComboKey1 = False
fcombo2X = -1.000000
fcombo2Y = -1.000000
comboKeyScale2 = 1.150000
ShowComboKey2 = False
fcombo3X = -1.000000
fcombo3Y = -1.000000
comboKeyScale3 = 1.150000
ShowComboKey3 = False
fcombo4X = -1.000000
fcombo4Y = -1.000000
comboKeyScale4 = 1.150000
ShowComboKey4 = False
Speed1KeyX = -1.000000
Speed1KeyY = -1.000000
Speed1KeyScale = 1.150000
ShowSpeed1Key = False
Speed2KeyX = -1.000000
Speed2KeyY = -1.000000
Speed2KeyScale = 1.150000
ShowSpeed2Key = False
XInputAnalogSensitivity = 1.000000
AnalogLimiterDeadzone = 0.600000
UseMouse = False
MapMouse = False
ConfineMap = False
MouseSensitivity = 0.100000
MouseSmoothing = 0.900000
[Network]
EnableWlan = False
EnableAdhocServer = False
[SystemParam]
PSPModel = 1
PSPFirmwareVersion = 660
NickName = PPSSPP
proAdhocServer = black-seraph.com
MacAddress = 81:e8:5d:26:d1:95
PortOffset = 0
Language = 1
TimeFormat = 1
DateFormat = 1
TimeZone = 0
DayLightSavings = False
ButtonPreference = 1
LockParentalLevel = 0
WlanAdhocChannel = 0
WlanPowerSave = False
EncryptSave = True
SavedataUpgradeVersion = True
[Debugger]
DisasmWindowX = -1
DisasmWindowY = -1
DisasmWindowW = -1
DisasmWindowH = -1
GEWindowX = -1
GEWindowY = -1
GEWindowW = -1
GEWindowH = -1
ConsoleWindowX = -1
ConsoleWindowY = -1
FontWidth = 8
FontHeight = 12
DisplayStatusBar = True
ShowBottomTabTitles = True
ShowDeveloperMenu = False
SkipDeadbeefFilling = False
FuncHashMap = False
[JIT]
[Upgrade]
UpgradeMessage = 
UpgradeVersion = 
DismissedVersion = 
[Theme]
ItemStyleFg = 0xffffffff
ItemStyleBg = 0x55000000
ItemFocusedStyleFg = 0xffffffff
ItemFocusedStyleBg = 0xffedc24c
ItemDownStyleFg = 0xffffffff
ItemDownStyleBg = 0xffbd9939
ItemDisabledStyleFg = 0x80eeeeee
ItemDisabledStyleBg = 0x55e0d4af
ItemHighlightedStyleFg = 0xffffffff
ItemHighlightedStyleBg = 0x55bdbb39
ButtonStyleFg = 0xffffffff
ButtonStyleBg = 0x55000000
ButtonFocusedStyleFg = 0xffffffff
ButtonFocusedStyleBg = 0xffedc24c
ButtonDownStyleFg = 0xffffffff
ButtonDownStyleBg = 0xffbd9939
ButtonDisabledStyleFg = 0x80eeeeee
ButtonDisabledStyleBg = 0x55e0d4af
ButtonHighlightedStyleFg = 0xffffffff
ButtonHighlightedStyleBg = 0x55bdbb39
HeaderStyleFg = 0xffffffff
InfoStyleFg = 0xffffffff
InfoStyleBg = 0x00000000
PopupTitleStyleFg = 0xffe3be59
PopupStyleFg = 0xffffffff
PopupStyleBg = 0xff303030
[Recent]
MaxRecent = 30
[PinnedPaths]
[Log]
SYSTEMEnabled = True
SYSTEMLevel = 4
BOOTEnabled = True
BOOTLevel = 4
COMMONEnabled = True
COMMONLevel = 4
CPUEnabled = True
CPULevel = 4
FILESYSEnabled = True
FILESYSLevel = 4
G3DEnabled = True
G3DLevel = 4
HLEEnabled = True
HLELevel = 4
JITEnabled = True
JITLevel = 4
LOADEREnabled = True
LOADERLevel = 4
MEEnabled = True
MELevel = 4
MEMMAPEnabled = True
MEMMAPLevel = 4
SASMIXEnabled = True
SASMIXLevel = 4
SAVESTATEEnabled = True
SAVESTATELevel = 4
FRAMEBUFEnabled = True
FRAMEBUFLevel = 4
SCEAUDIOEnabled = True
SCEAUDIOLevel = 4
SCECTRLEnabled = True
SCECTRLLevel = 4
SCEDISPEnabled = True
SCEDISPLevel = 4
SCEFONTEnabled = True
SCEFONTLevel = 4
SCEGEEnabled = True
SCEGELevel = 4
SCEINTCEnabled = True
SCEINTCLevel = 4
SCEIOEnabled = True
SCEIOLevel = 4
SCEKERNELEnabled = True
SCEKERNELLevel = 4
SCEMODULEEnabled = True
SCEMODULELevel = 4
SCENETEnabled = True
SCENETLevel = 4
SCERTCEnabled = True
SCERTCLevel = 4
SCESASEnabled = True
SCESASLevel = 4
SCEUTILEnabled = True
SCEUTILLevel = 4
SCEMISCEnabled = True
SCEMISCLevel = 4
LunaMoo commented 5 years ago

You don't have anything mouse related mapped in your control mapping - 1 = keyboard and 10 = generic gamepad which I assume is your touchpad - so no, the merged PR should not affect you in any way.

If you think touchpad is mapped in a really awful way like direction ends up as circle which causes pressing that direction to leave menus in the UI, you can provide better mapping for said touchpad through gamecontrollerdb.txt(can be edited by for example this tool, it could also be completely removed from that file as [Unknown] proposed above, but that will make it completely unusable for PPSSPP. If it's also detected as mouse it might become usable after some linux user implements mouse control for that OS, but there's not that many contributors from Linux so it might not happen anytime soon.

i30817 commented 5 years ago

No rush actually, i'm using retroarch version, which doesn't have this problem (not sure if it would exist if the internal UI existed in the libretro version, but it doesn't).

I'm just notifying you so you're aware that this problem still exists and if you spotted something. I'm actually surprised no one else confirmed it. Maybe it's something that only happens in wayland or everyone simply uses gamepads. I find it really weird.

I 'know' it's a mapping from the analog controls, because if i start a game that uses them (in this case the 3rd birthday) i can move the character with the touchpad, which is something i never actually configured ( i use the keyboard for everything ).

Anyway, thanks for linking that tool, it's SDL2 fault then... couldn't this particular situation in PPSSPP be avoided by making sure that the 'controller' is not mapped to the same device as the mouse in the UI and giving priority to the mouse when they conflict? I don't actually mind the analog mapping to the only 'analog' device on the keyboard in games.

unknownbrackets commented 5 years ago

I guess we could search for "TouchPad" in the name of detected mappings and deny them? Sounds like this is actually a mapping not currently in gamecontrollerdb - just being autodetected by SDL2 wrong.

Not sure if there's some flag that comes back that this isn't really a controller.

I don't know that we get a device. See here: https://github.com/hrydgard/ppsspp/blob/aa927e0681ed76fec3b540218981a2c407a78e47/SDL/SDLJoystick.cpp#L53-L67

Please note that SDL_IsGameController returns false for a large number of devices - basically any controller that isn't specifically whitelisted in gamecontrollerdb already.

-[Unknown]

hrydgard commented 3 years ago

Is this still happening, should we do something about it?

This is the only instance of this issue I've ever heard about, never even seen it in my email flood.

i30817 commented 3 years ago

I changed portable (the other died) and i'm not using standalone ppsspp anymore, so you can close this if you can't reproduce.

It was really frustrating though. Just imagine trying to navigate the menus and every time you moved the cursor there was a 80% chance of having a submenu closed on the savestate menu.

hrydgard commented 3 years ago

Yeah I can imagine, but it's gotta be rare. Unlikely to work on this unless it comes up again though, so closing.