stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] Sending keypress events to an application


From: Sven Hartrumpf
Subject: [STUMP] Sending keypress events to an application
Date: Thu, 20 Jan 2011 16:48:54 +0100 (CET)

Thanks Ben for your answers.

I asked:
SH >> I am looking for examples how to automatically send 
SH >> several keypress events to the current application,
SH >> e.g. to the Acrobat Reader.

Ben answered:
> You may be able to use the 'meta' command for this, eg:
> (stumpwm::meta (kbd "C-M-o"))

This works partially.

I tried functions like this to automatically save the text
from within acroread:

(defcommand save-acroread-to-text ()
  ()
  "Save text from within acroread"
  (stumpwm::meta (kbd "A-f"))
  ;(run-shell-command "sleep 2" t)
  (stumpwm::meta (kbd "v"))
  ;(run-shell-command "sleep 2" t)
  (stumpwm::meta (kbd "Return"))
  ;(stumpwm::meta (kbd "C-q"))
  )

(define-key *top-map* (kbd "F6") "save-acroread-to-text")
 
But the problem is that for a sequence of keys later keys
might not reach the window. And: acroread (or my setup)
seem to block the Alt (A-) modifier.

> If this doesn't work, you may want to try XTest.  There's a
> thread describing its use with stumpwm here: 
> http://lists.nongnu.org/archive/html/stumpwm-devel/2008-08/msg00014.html

This sounds interesting, but the links contained in this message
are no longer valid.

Greetings
Sven



reply via email to

[Prev in Thread] Current Thread [Next in Thread]