Skip to content

Commit

Permalink
UserInputHandler: add API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Sep 6, 2024
1 parent 7cde73e commit 0375403
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/UserInputHandler.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,27 @@
enum class Command : unsigned;
struct Point;

/**
* Handler for input events from the user, called by #AsyncUserInput.
*/
class UserInputHandler {
public:
/**
* A hot key for a #Command was pressed.
*
* @return false if ncmpc will quit
*/
virtual bool OnCommand(Command cmd) noexcept = 0;

#ifdef HAVE_GETMOUSE
/**
* An input event from the mouse was detected.
*
* @param p the position of the mouse cursor on the screen
* @param bstate the state of all mouse buttons
*
* @return false if ncmpc will quit
*/
virtual bool OnMouse(Point p, mmask_t bstate) noexcept = 0;
#endif
};

0 comments on commit 0375403

Please sign in to comment.