Dieter Graef / USBHost_DISCO-F746NG

Dependents:   DISCO-F746NG_USB_Host

Fork of KL46Z-USBHost by Norimasa Okamoto

Embed: (wiki syntax)

« Back to documentation index

USBHostMouseKb Class Reference

USBHostMouseKb Class Reference

A class to communicate a USB mouse. More...

#include <USBHostMouseKeyboard.h>

Inherits IUSBEnumerator.

Public Member Functions

 USBHostMouseKb (int Interface)
 Constructor.
bool connect ()
 Try to connect a mouse device.
bool connected ()
 Check if a mouse is connected.
void attachMouseEvent (void(*ptr)(uint8_t buttons, int8_t x, int8_t y, int8_t z))
 Attach a callback called when a mouse event is received.
void attachButtonEvent (void(*ptr)(uint8_t buttons))
 Attach a callback called when the button state changes.
void attachXEvent (void(*ptr)(int8_t x))
 Attach a callback called when the X axis value changes.
void attachYEvent (void(*ptr)(int8_t y))
 Attach a callback called when the Y axis value changes.
void attachZEvent (void(*ptr)(int8_t z))
 Attach a callback called when the Z axis value changes (scrolling)
void attachKb (void(*ptr)(uint8_t key))
 Attach a callback called when a keyboard event is received.
void attachKb (void(*ptr)(uint8_t keyCode, uint8_t modifier))
 Attach a callback called when a keyboard event is received.

Detailed Description

A class to communicate a USB mouse.

Definition at line 19 of file USBHostMouseKeyboard.h.


Constructor & Destructor Documentation

USBHostMouseKb ( int  Interface )

Constructor.

Definition at line 141 of file USBHostMouseKeyboard.cpp.


Member Function Documentation

void attachButtonEvent ( void(*)(uint8_t buttons)  ptr )

Attach a callback called when the button state changes.

Parameters:
ptrfunction pointer

Definition at line 59 of file USBHostMouseKeyboard.h.

void attachKb ( void(*)(uint8_t key)  ptr )

Attach a callback called when a keyboard event is received.

Parameters:
ptrfunction pointer

Definition at line 104 of file USBHostMouseKeyboard.h.

void attachKb ( void(*)(uint8_t keyCode, uint8_t modifier)  ptr )

Attach a callback called when a keyboard event is received.

Parameters:
ptrfunction pointer

Definition at line 115 of file USBHostMouseKeyboard.h.

void attachMouseEvent ( void(*)(uint8_t buttons, int8_t x, int8_t y, int8_t z)  ptr )

Attach a callback called when a mouse event is received.

Parameters:
ptrfunction pointer

Definition at line 48 of file USBHostMouseKeyboard.h.

void attachXEvent ( void(*)(int8_t x)  ptr )

Attach a callback called when the X axis value changes.

Parameters:
ptrfunction pointer

Definition at line 70 of file USBHostMouseKeyboard.h.

void attachYEvent ( void(*)(int8_t y)  ptr )

Attach a callback called when the Y axis value changes.

Parameters:
ptrfunction pointer

Definition at line 81 of file USBHostMouseKeyboard.h.

void attachZEvent ( void(*)(int8_t z)  ptr )

Attach a callback called when the Z axis value changes (scrolling)

Parameters:
ptrfunction pointer

Definition at line 92 of file USBHostMouseKeyboard.h.

bool connect (  )

Try to connect a mouse device.

Returns:
true if connection was successful

Definition at line 174 of file USBHostMouseKeyboard.cpp.

bool connected (  )

Check if a mouse is connected.

Returns:
true if a mouse is connected

Definition at line 166 of file USBHostMouseKeyboard.cpp.