This are the (new) Support Forums for FSUIPC and related products.

These forums replace the old support forums which have been running for 20+ years. The old forums contain a wealth of information on all FSUIPC products, and are still available (until the end of the year) for read-only here.

At the moment these new forums are quite empty – I will be updating the FAQ section and copying across the User Contributions from the old forums in the next few months.

Please note that you will need to Register and Login to post for support, and also to download attachments. You can view these forums without registering.

Support is also available via Discord. Please use the following invite link to join the FSUIPC Discord server:
                           https://discord.gg/zjwUTrxmmE

Notifications
Clear all

mousemove.lua - move mouse to upper window edge of FSX if the mouse is not used

(@fsuipc)
Posts: 17
Admin
Topic starter
 
-- Copyright 2016 Thomas Arendsen Hein <thomas@jtah.de>
--
-- Copying and distribution of this file, with or without modification,
-- are permitted in any medium without royalty provided the copyright
-- notice and this notice are preserved.  This file is offered as-is,
-- without any warranty.

-- Move mouse to upper window edge of FSX window mouse is not used.
-- Workaround for a performance issue when the mouse pointer is
-- inside the FSX window.
-- This script requires a registered copy of FSUIPC 4.949f or newer.
--
-- Install inside the FSUIPC modules directory:
-- 1. save this file as FSX/Modules/lua/mousemove.lua
-- 2. add ipc.runlua('lua\\movemouse') to FSX/Modules/ipcReady.lua

function mousemove_reset()
  mousemove_timeout = 3
end

function mousemove_timer()
  x, y = mouse.getpos()
  if x ~= mousemove_old_x or y ~= mousemove_old_y then
    mousemove_reset()
    mousemove_old_x = x
    mousemove_old_y = y
  elseif mousemove_timeout > 0 then
    mousemove_timeout = mousemove_timeout - 1
  elseif mousemove_timeout == 0 then
    mousemove_timeout = -1
    if ext.hasfocus() then
      mouse.move(25, 0, 2) -- left half of FS top edge
    end
  end
end

mousemove_old_x = nil
mousemove_old_y = nil
event.mouseleft("mousemove_reset")
event.mousemiddle("mousemove_reset")
event.mouseright("mousemove_reset")
event.mousewheel("mousemove_reset")
event.mousehoriz("mousemove_reset")
event.timer(1000, "mousemove_timer")

Same file as attachment for your convenience:

[Originally contributed in old SimMarket support forums by Thomas Arendsen Hein / user ThomasAH]


 
Posted : November 13, 2025 1:51 pm