PSPSDK 2024-12-16
Loading...
Searching...
No Matches
SceCtrlLatch Struct Reference

Controller latch data. More...

#include <ctrl/pspctrl.h>

Data Fields

unsigned int uiMake
 Button transitioned to pressed state.
 
unsigned int uiBreak
 Button transitioned to released state.
 
unsigned int uiPress
 Button is in the pressed state.
 
unsigned int uiRelease
 Button is in the released state.
 

Detailed Description

Controller latch data.

Contains information about button state changes between two controller service sampling cycles. With each sampling cycle, the controller service compares the new pressed & releasedbutton states with the previously collected pressed button states. This comparison will result in the following possible states for each button:

  • Make - The button has just been pressed with its prior state being the released state. Transition from 'released' state to 'pressed' state.
  • Press - The button is currently in the 'pressed' state.
  • Break - The button has just been released with its prior state being the 'pressed' state. Transition from 'pressed' state to 'release' state.
  • Release - The button is currently in the 'released' state.

It is possible for a button to (briefly) be in two states at the same time. Valid combinations are as follows:

  • Make & Press
  • Break & Release

In other words, if a button is in the Make state, then it is also in the Press state. However, this is not the case for the inverse. A button in the Press state does not need to be in the Make state.

Mask the values with one or more PspCtrlButtons flags to access specific buttons.

These comparison results are stored internally as latch data and can be retrieved using the APIs sceCtrlPeekLatch() and sceCtrlReadLatch().

Remarks
The same can be accomplished by using the different sceCtrl[Read/Peek]Buffer[Positive/Negative]() APIs and comparing the currently collected button sampling data with the previously collected one.
See also
PspCtrlButtons
sceCtrlPeekLatch()
sceCtrlReadLatch()

Field Documentation

◆ uiBreak

unsigned int SceCtrlLatch::uiBreak

Button transitioned to released state.

◆ uiMake

unsigned int SceCtrlLatch::uiMake

Button transitioned to pressed state.

◆ uiPress

unsigned int SceCtrlLatch::uiPress

Button is in the pressed state.

◆ uiRelease

unsigned int SceCtrlLatch::uiRelease

Button is in the released state.


The documentation for this struct was generated from the following file: