You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.2 KiB
C

/**
*
* @file FITKKeyMouseStates.h
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*
*/
#ifndef __FITKKeyMouseStates_H__
#define __FITKKeyMouseStates_H__
#include "FITKAppFrameworkAPI.h"
#include <QMap>
#include <QMutex>
namespace AppFrame
{
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
class FITKAppFrameworkAPI FITKKeyMouseStates
{
public:
explicit FITKKeyMouseStates() = default;
virtual ~FITKKeyMouseStates() = default;
/**
* @brief
* @param[i] key
* @param[i] p true
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void keyPressed(Qt::Key key, bool p);
/**
* @brief
* @param[i] key
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
bool keyPressed(Qt::Key key);
/**
* @brief
* @param[i] button
* @param[i] p
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void mousePressed(Qt::MouseButton button, bool p);
/**
* @brief
* @param[i] button
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
bool mousePressed(Qt::MouseButton button);
/**
* @brief
* @return true
* @return false
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-09
*/
bool isMousePressed();
/**
* @brief
* @return true
* @return false
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-09
*/
bool isMouseMoved() const;
/**
* @brief
* @param[i] m
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-09
*/
void mouseMoved(const bool& m);
private:
/**
* @brief ,true
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
QMap<Qt::Key, bool> _keyStates;
/**
* @brief ,true
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
QMap<Qt::MouseButton, bool> _mouseButtonStates;
/**
* @brief
* @author libaojun (libaojunqd@Foxmail.com)
* @date 2024-05-09
*/
bool _mouseMoved{ false };
};
}
#endif // !__GUISETTING_H__