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锁定鼠标。

最新文章

  1. 微型orm fluentdata
  2. 黄聪:wordpress/wp-includes目录文件
  3. ORACLE-树状数据结构获取各层级节点信息
  4. [DEncrypt] HashEncode--哈希加密帮助类 (转载)
  5. 同步的HTTP请求
  6. MPMoviePlayerController 电影播放器—备用
  7. 读书时间《JavaScript高级程序设计》六:事件
  8. 数据访问层的改进以及测试DOM的发布
  9. MYsql优化where子句
  10. Java中equal和==区别及String创建过程
  11. Head First Java设计模式思维导图总结
  12. Laravel5中通过SimpleQrCode扩展包生成二维码实例
  13. python实战学习之matplotlib绘图
  14. Java类的加载时机
  15. php 处理上百万条的数据库如何提高处理查询速度
  16. maven 引用另一个jar包 需要先打包在仓库里面 并在pom里面配置 才可以引用
  17. ES系列七、ES-倒排索引详解
  18. Python day3_string的常见方法2_笔记
  19. LaTeX技巧:如何高效地将LaTeX代码转为Word公式
  20. WritePrivateProfileString GetPrivateProfileString 读取写 配置文件

热门文章

  1. 第一篇 css导入方式 及选择器
  2. uboot 2013.01 代码简析(3)第二阶段初始化
  3. castle windsor学习----- CastleComponentAttribute 特性注册
  4. Jquery实现动态导航栏和轮播导航栏
  5. Neutron Messaging Callback System
  6. CSS重置 reset.css
  7. 纯CSS3跳动焦点广告轮播特效
  8. delphi数据库的备份及还原
  9. POJ 3349 Snowflake Snow Snowflakes(哈希表)
  10. python UDP CS demo