Recent

Author Topic: MouseAndKeyInput on Mac  (Read 2463 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
MouseAndKeyInput on Mac
« on: January 23, 2019, 06:14:24 pm »
Hi guys, a question. I want to use the MouseAndKeyInput library to move the mouse from my Lazarus program and send the clicks to the operating system. But on the mac it tells me this when I try to compile. Ideas?

Code: Pascal  [Select]
  1. Messages, Warnings: 1
  2. Compile Project, Target: lib/x86_64-darwin/LazMouseDesktop: Exit code 256, Errors: 1
  3. Linking /Users/ngit/Desktop/LazMouseDesktop/src/lib/x86_64-darwin/LazMouseDesktop
  4. ld: library not found for -lXtst
  5. An error occurred while linking
  6. LazMouseDesktop.lpr(22,0) Error: Error while linking
  7.  
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

bytebites

  • Full Member
  • ***
  • Posts: 217
Re: MouseAndKeyInput on Mac
« Reply #1 on: January 23, 2019, 06:58:27 pm »
Library libxtst-dev is missing.

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: MouseAndKeyInput on Mac
« Reply #2 on: January 23, 2019, 11:31:05 pm »
Library libxtst-dev is missing.

How install this package on mac os x?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: MouseAndKeyInput on Mac
« Reply #3 on: January 23, 2019, 11:51:30 pm »
Ok, is simple. Add this path /opt/X11/lib at project library path into project options.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: MouseAndKeyInput on Mac
« Reply #4 on: January 24, 2019, 12:00:55 am »
Ok, compile but not run correctly. If I run project from terminal of mac os return this errore when execute my mouse move

Xlib:  extension "XTEST" missing on display "/private/tmp/com.apple.launchd.QuNixpuowN/org.macosforge.xquartz:0".
Xlib:  extension "XTEST" missing on display "/private/tmp/com.apple.launchd.QuNixpuowN/org.macosforge.xquartz:0".
Xlib:  extension "XTEST" missing on display "/private/tmp/com.apple.launchd.QuNixpuowN/org.macosforge.xquartz:0".
Xlib:  extension "XTEST" missing on display "/private/tmp/com.apple.launchd.QuNixpuowN/org.macosforge.xquartz:0".
Xlib:  extension "XTEST" missing on display "/private/tmp/com.apple.launchd.QuNixpuowN/org.macosforge.xquartz:0".

Why?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

bytebites

  • Full Member
  • ***
  • Posts: 217

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: MouseAndKeyInput on Mac
« Reply #6 on: January 24, 2019, 08:49:11 am »
So to work my program should then rely on XQuartz on Mac OS. Is not there a way to control the mouse and keyboard programmatically through operating system bees? So for windows and linux I use the libraries of Lazarus and for mac I use the bees of the system.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1