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窗口锁定鼠标开关的更多相关文章

  1. Qt 隐藏标题栏 窗口移动 鼠标事件

    摘要 隐藏标题栏 头文件声明鼠标移动虚函数 .cpp文件实现功能 1 setWindowFlags(Qt::FramelessWindowHint | windowFlags()); 无标题栏移动窗体 ...

  2. Qt窗口添加鼠标移动拖拽事件

    1. .h文件中添加 private:    QPoint dragPosition; 2. 在cpp文件中重写鼠标点击和拖拽函数 void ShapeWidget::mousePressEvent( ...

  3. VC++ SetLayeredWindowAttributes 部分窗口透明鼠标穿透

    在初始化中使用下面两行代码 ModifyStyleEx(0, WS_EX_LAYERED); ::SetLayeredWindowAttributes(m_hWnd, RGB(1, 255, 0), ...

  4. unity中锁定鼠标移动&&隐藏鼠标&&强制是鼠标移动到某一位置

    [System.Runtime.InteropServices.DllImport("user32.dll")] //引入dll public static extern int ...

  5. 【windows】窗口锁定状态如何关机

    在锁定界面下方有一个——切换用户,点击,过一会右下角就有一个红色的圆圈,就可以关机了.

  6. Delphi锁定鼠标 模拟左右键 静止一会自动隐藏鼠标

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  7. qt 自定义窗口显示鼠标划过的轨迹

    鼠标事件分为四种: 1.按下 2.抬起 3.移动 4.双击 鼠标事件继承与QWidget void mouseDoubleClickEvent(QMouseEvent *event) void mou ...

  8. wxpython 简单例子:显示文本框的窗口显示鼠标位置

    简单例子来自教程: #!/bin/env python import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__ ...

  9. .Net鼠标随动窗口

    就像QQ宠物或者迅雷悬浮窗口一样,鼠标点下去窗体跟着鼠标动 主要是两个时间的加载 MouseDown和MouseMove事件 MouseDown事件: private int _StartX ;//鼠 ...

随机推荐

  1. java WEB学习笔记32:HttpSession 接口常用方法 及 HttpServletRequest接口中的Session方法 Demo

    本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...

  2. redis主从架构及redis集群

    https://redis.io/topics/cluster-spec Redis Cluster does not support multiple databases like the stan ...

  3. GetWindowRect和GetClientRect比较学习

    一:关于坐标 MFC中绘图时经常涉及到坐标计算,GetWindowRect和GetClientRect这两个函数,是获取逻辑坐标系中窗口或控件(其实也是窗口)大小和坐标的常用函数了,有什么不一样的? ...

  4. Qt之任务栏系统托盘图标

    转自  --> http://blog.csdn.net/qivan/article/details/7506306 托盘图标,一个自己脑子出现很久的词,可惜自己都没动手去实现.最近看见的,听见 ...

  5. 分享知识-快乐自己:Linux下安装 erlang 及 RabbitmMQ

    Linux下安装 erlang 及 RabbitmMQ: 下载地址一  下载地址二 下载地址三 安装依赖: yum install ncurses-devel 安装 erlang: 1):下载Erla ...

  6. 用React写一个工大导航

    Online: https://brenner8023.github.io/gdut-nav/ GitHub地址: https://github.com/brenner8023/gdut-nav 笔者 ...

  7. 关于自动化与vTable两种暴露接口的区别-1未完......

    COM组件有两种暴露组件接口的方式,一种是以虚拟列表的方式暴露:一种就是自动化方式. 虚拟列表(VTable): COM组件将自己所有的方法的地址以一个虚拟表的方式存放在一起,这个虚拟表是一种结构,有 ...

  8. Java 时间和日期类型的 Hibernate 映射

    以下情况下必须显式指定 Hibernate 映射类型 一个 Java 类型可能对应多个 Hibernate 映射类型. 例如: 如果持久化类的属性为 java.util.Date 类型, 对应的 Hi ...

  9. windows 7下mingw+msys编译ffmpeg

      windows 7下mingw+msys编译ffmpeg   1-->下载安装MingW,mingw-get-inst-20120426.exe  http://sourceforge.ne ...

  10. ffmpeg推流命令参数记录

    列出我们本机的设备:ffmpeg -list_devices true -f dshow -i dummy .\ffmpeg -r 25 -f dshow -s 640*480 -i video=&q ...