Graphics v0.0.0
A simple abstraction layer for the modern graphics APIs.
载入中...
搜索中...
未找到
Input类 参考

键盘/鼠标输入. 更多...

#include <Input.h>

静态 Public 成员函数

static bool is_pressed (Key key)
 获取键盘按键状态. 更多...
 
static bool is_pressed (Mouse key)
 获取鼠标按键状态. 更多...
 
static Vector2 get_mouse_position ()
 获取光标相对窗口的位置.
 
static Key get_key_by_name (std::string_view name)
 通过名称获取键盘按键. 更多...
 
static Mouse get_mouse_by_name (std::string_view name)
 通过鼠标获取键盘按键. 更多...
 
static std::string_view get_clipboard ()
 获取剪切板内容, UTF-8 编码.
 
static void set_clipboard (const std::string &str)
 设置剪切板内容, UTF-8 编码. 更多...
 
static void set_window (const Window &win)
 设置接受输入的窗口.
 

详细描述

键盘/鼠标输入.

成员函数说明

◆ get_key_by_name()

Key Input::get_key_by_name ( std::string_view  name)
static

通过名称获取键盘按键.

参数
name键盘按键名称.

◆ get_mouse_by_name()

Mouse Input::get_mouse_by_name ( std::string_view  name)
static

通过鼠标获取键盘按键.

参数
name鼠标按键名称.

◆ is_pressed() [1/2]

bool Input::is_pressed ( Key  key)
static

获取键盘按键状态.

参数
key键盘按键.
返回
true 按键按下.
false 按键抬起.

◆ is_pressed() [2/2]

bool Input::is_pressed ( Mouse  key)
static

获取鼠标按键状态.

参数
key键盘按键.
返回
true 按键按下.
false 按键抬起.

◆ set_clipboard()

void Input::set_clipboard ( const std::string &  str)
static

设置剪切板内容, UTF-8 编码.

参数
str要设置的内容.

该类的文档由以下文件生成: