其他分享
首页 > 其他分享> > Wayland helloworld (三)之Wayland键盘消息

Wayland helloworld (三)之Wayland键盘消息

作者:互联网

原文链接:https://my.oschina.net/txl/blog/266932

Wayland键盘消息

void keyboard_keymap(LPVOID data, HKEYBOARD wl_keyboard, uint32_t format, int32_t fd, uint32_t size)
{

}

void keyboard_enter(LPVOID data, HKEYBOARD wl_keyboard, uint32_t serial, HSURFACE surface, struct wl_array *keys)
{
	printf("keyboard focus.\n");
}

void keyboard_leave(void *data, HKEYBOARD wl_keyboard, uint32_t serial, HSURFACE surface)
{

}

void keyboard_key(void *data, HKEYBOARD wl_keyboard,
	uint32_t serial,
	uint32_t time,
	uint32_t key,
	uint32_t state)
{
	if (KEY_F4 == key && WL_KEYBOARD_KEY_STATE_PRESSED == state)
	{
		exit(0);
	}
}

void keyboard_modifiers(void *data,
	HKEYBOARD wl_keyboard,
	uint32_t serial,
	uint32_t mods_depressed,
	uint32_t mods_latched,
	uint32_t mods_locked,
	uint32_t group)
{

}

struct wl_keyboard_listener keyboard_listener = 
{
	.keymap = keyboard_keymap, 
	.enter = keyboard_enter, 
	.leave = keyboard_leave, 
	.key = keyboard_key, 
	.modifiers = keyboard_modifiers
};





转载于:https://my.oschina.net/txl/blog/266932

标签:void,wl,helloworld,键盘,Wayland,key,keyboard,uint32,HKEYBOARD
来源: https://blog.csdn.net/chenie3544/article/details/100623487