unreal3窗口锁定鼠标开关
GameViewportClient中有个变量控制是否显示硬件鼠标:
var transient bool bDisplayHardwareMouseCursor
也就是系统的光标,一般通过该类中的函数来操纵:
simulated event SetHardwareMouseCursorVisibility(bool bIsVisible)
{
local Vector2D ViewportSize; //If we are going to be turning on the hardware cursor when it was not already on, we will move the cursor to the middle of the screen
if (bIsVisible && !bDisplayHardwareMouseCursor)
{
GetViewportSize(ViewportSize);
SetMouse(ViewportSize.X/,ViewportSize.Y/);
}
bDisplayHardwareMouseCursor = bIsVisible; ForceUpdateMouseCursor(TRUE);
}
其中ForceUpdateMouseCursor是native函数,调用到UGameViewportClient::ForceUpdateMouseCursor,
在Windows上的实现类为FWindowsViewport,其成员函数
void FWindowsViewport::UpdateMouseLock( UBOOL bEnforceMouseLockRequestedFlag )
在每个tick中被调用,会对该控制变量进行检测:
RECT ClipRect;
UBOOL bIsHardwareCursorVisible = (GEngine && GEngine->GameViewport && GEngine->GameViewport->bDisplayHardwareMouseCursor);
UBOOL bIsAnyCursorVisible = bIsSystemCursorVisible || bIsHardwareCursorVisible;
UBOOL bClipRectValid = (::GetClipCursor( &ClipRect ) != );
UBOOL bHasFocus = HasFocus();
UBOOL bShouldMouseLock = bEnforceMouseLockRequestedFlag ? bMouseLockRequested : bHasFocus && (IsFullscreen() || !bIsAnyCursorVisible || bMouseLockRequested);
最后在bShouldMouseLock为TRUE时,调用::ClipCursor锁定鼠标。
unreal3窗口锁定鼠标开关的更多相关文章
- Qt 隐藏标题栏 窗口移动 鼠标事件
摘要 隐藏标题栏 头文件声明鼠标移动虚函数 .cpp文件实现功能 1 setWindowFlags(Qt::FramelessWindowHint | windowFlags()); 无标题栏移动窗体 ...
- Qt窗口添加鼠标移动拖拽事件
1. .h文件中添加 private: QPoint dragPosition; 2. 在cpp文件中重写鼠标点击和拖拽函数 void ShapeWidget::mousePressEvent( ...
- VC++ SetLayeredWindowAttributes 部分窗口透明鼠标穿透
在初始化中使用下面两行代码 ModifyStyleEx(0, WS_EX_LAYERED); ::SetLayeredWindowAttributes(m_hWnd, RGB(1, 255, 0), ...
- unity中锁定鼠标移动&&隐藏鼠标&&强制是鼠标移动到某一位置
[System.Runtime.InteropServices.DllImport("user32.dll")] //引入dll public static extern int ...
- 【windows】窗口锁定状态如何关机
在锁定界面下方有一个——切换用户,点击,过一会右下角就有一个红色的圆圈,就可以关机了.
- Delphi锁定鼠标 模拟左右键 静止一会自动隐藏鼠标
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...
- qt 自定义窗口显示鼠标划过的轨迹
鼠标事件分为四种: 1.按下 2.抬起 3.移动 4.双击 鼠标事件继承与QWidget void mouseDoubleClickEvent(QMouseEvent *event) void mou ...
- wxpython 简单例子:显示文本框的窗口显示鼠标位置
简单例子来自教程: #!/bin/env python import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__ ...
- .Net鼠标随动窗口
就像QQ宠物或者迅雷悬浮窗口一样,鼠标点下去窗体跟着鼠标动 主要是两个时间的加载 MouseDown和MouseMove事件 MouseDown事件: private int _StartX ;//鼠 ...
随机推荐
- 【leetcode刷题笔记】Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...
- python 3 并发编程多进程 paramiko 模块
python 3 paramiko模块 paramiko是一个用于做远程控制的模块,使用该模块可以对远程服务器进行命令或文件操作,值得一说的是,fabric和ansible内部的远程管理就是使用的pa ...
- (转)Windows下面安装和配置MySQL(5.6.20)
原文地址:http://www.cnblogs.com/qiyebao/p/3887055.html 1.首先到http://dev.mysql.com/ 上下载windows版mysql5.6免安装 ...
- Ubuntu14 下安装jdk1.8
1.oracle官网下载jdk-8u45-linux-i586.gz 此为32位 2.放在任意目录下,如/home/hongxf 3.直接解压该文件 sudo tar -xvf jdk-8u45-li ...
- jQuery cookie 实现记住用户名和密码功能
jQuery cookie 实现记住用户名和密码功能 HTML代码 <div class="wrap"> <div class="line-top&qu ...
- 自定义响应结构 AjaxResult()
package com.dsj.gdbd.utils.ajax; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxm ...
- 一个基于特征向量的近似网页去重算法——term用SVM人工提取训练,基于term的特征向量,倒排索引查询相似文档,同时利用cos计算相似度
摘 要 在搜索引擎的检索结果页面中,用户经常会得到内容相似的重复页面,它们中大多是由于网站之间转载造成的.为提高检索效率和用户满意度,提出一种基于特征向量的大规模中文近似网页检测算法DDW(Det ...
- python--17个新手常见Python运行时错误
当初学 Python 时,想要弄懂 Python 的错误信息的含义可能有点复杂.这里列出了常见的的一些让你程序 crash 的运行时错误. 1)忘记在 if , elif , else , for , ...
- 201621123014《JAVA程序设计》第1周学习总结
1. 本章学习总结 关键字:JAVA特点.JDK.JVM.JRE.class.编译工具.JDK是JAVA的开发工具包,拥有JAVA需要的环境和各类JAVA工具,是JAVA的核心:JVM是JAVA虚拟机 ...
- codeforces 653C C. Bear and Up-Down(乱搞题)
题目链接: C. Bear and Up-Down time limit per test 2 seconds memory limit per test 256 megabytes input st ...