Recent

Author Topic: Placing text at cursor position (outside of current app)  (Read 6308 times)

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Placing text at cursor position (outside of current app)
« on: March 16, 2011, 12:33:31 am »
For example my app has text which should be dropped in eg gedit at edit cursor position automatically.
Thanks,
Alistair
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Placing text at cursor position (outside of current app)
« Reply #1 on: March 16, 2011, 12:37:50 am »
Ctrl+V ? ^^

Once you are outside your app, your app has no more control on your mouse or keyboard.
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Re: Placing text at cursor position (outside of current app)
« Reply #2 on: March 16, 2011, 06:35:28 am »
Ctrl+V ? ^^

Once you are outside your app, your app has no more control on your mouse or keyboard.
A double gut punch - there is no way I am able to incorporate hotkeys system-wide nor editor operations on other apps using FPC outside of Windows.
Delphi in windows does this, Glippy in Ubuntu which uses Mono does this, but FPC cant.
Sad I have progressed well up to this point to have to close the project down.
Thanks for confirming my thoughts.
Al
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11446
  • Debugger - SynEdit - and more
    • wiki
Re: Placing text at cursor position (outside of current app)
« Reply #3 on: March 16, 2011, 12:54:57 pm »
Well, If you have proof that it is supported by the OS, then there will be a way.... but not necessarily an easy one.

You may have to do it from scratch for each OS, find the documentation of the OS (or Toolkit, like GTK), find out what API to call, maybe translate the c headers to pascal, and then call those functions.

Anyway, there is a MouseAndKeyInput package. It allows you to simulate mouse move, and key clicks. I have never tested it, and I do not know if it supports simulation across applications, yet it might...
If so, you may be able to send keystrokes...
But as I said, I never used it myself.

AlistairG

  • Jr. Member
  • **
  • Posts: 70
Re: Placing text at cursor position (outside of current app)
« Reply #4 on: March 16, 2011, 08:46:44 pm »
Hi mouseandkeyinput is simply that - it has a stringgrid which with the code enables movement of mouse and keys in input mode; once again not outside of the application/app minimized.
Thanks,
Alistair.
Lazarus 0.9.28.2-10ubuntu1 r22277 FPC 2.4.0 i386-linux-gtk 2 (beta)
       My pledge - if I waste your time, I donate to Lazarus.

 

TinyPortal © 2005-2018