Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst] Fokus per Programm auf anderes Fenster übertragen
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
cyclohexan
n00b
n00b


Joined: 11 Nov 2004
Posts: 50
Location: Germany

PostPosted: Tue Nov 06, 2007 11:54 pm    Post subject: [gelöst] Fokus per Programm auf anderes Fenster übertragen Reply with quote

Hallo,

gibt es eine Möglichkeit, per Programmcode den Fokus von einem Fenster auf ein anderes zu übertragen?
Die Programmiersprache ist mir ziemlich egal. Im Prinzip würde es mir reichen, wenn ich per Programm sowas simulieren könnte, als wenn ich über die Tastatur Alt-Tab drücken würde.

Beispiel:
Ich arbeite unter KDE und habe eine Konsole geöffnet. In der Konsole starte ich das Programm XYZ.
Das Programm XYZ macht folgendes:
1. Es startet Firefox. (Den Fokus bekommt jetzt natürlich das Firefox-Fenster)
2. Das Programm XYZ veranlasst, dass das Konsolenfenster wieder aktiviert wird (also den Fokus bekommt).

Wie müsste der Programmteil ungefähr aussehen, der den Fokus wechselt? (Also Schritt 2)
Eine Lösung für Perl würde besonders gut passen, aber wie gesagt, jede andere Programmiersprache tut's auch.


Last edited by cyclohexan on Wed Nov 07, 2007 7:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
Finswimmer
Bodhisattva
Bodhisattva


Joined: 02 Sep 2004
Posts: 5467
Location: Langen (Hessen), Germany

PostPosted: Wed Nov 07, 2007 10:54 am    Post subject: Reply with quote

$wmctrl -a "Gentoo Forums :: Search - Mozilla Firefox"

Den String bekommst du über wmctrl -l
Die -a Option wechselt für dich sogar noch den Desktop, falls das gewünschte Fenster woanders ist.

Tobi
_________________
Bitte auf Rechtschreibung, korrekte Formatierung und Höflichkeit achten!
Danke
Back to top
View user's profile Send private message
Qubit
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2002
Posts: 136
Location: /dev/urandom

PostPosted: Wed Nov 07, 2007 2:21 pm    Post subject: Reply with quote

Evtl. gehts unter KDE-3.X auch per dcop.

Gruß Daniel
_________________
©Qubit
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Wed Nov 07, 2007 2:58 pm    Post subject: Reply with quote

Qubit wrote:
Evtl. gehts unter KDE-3.X auch per dcop.


Kannst du bitte auch schreiben wie?
Back to top
View user's profile Send private message
Qubit
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2002
Posts: 136
Location: /dev/urandom

PostPosted: Wed Nov 07, 2007 3:12 pm    Post subject: Reply with quote

Wie gesagt evtl...in der Art: (sollte mehr ein anstoss sein)

Code:
dcop konsole-$ID konsole-mainwindow#1


Eine schöne Übersicht bekommt man auch per kdcop.

Gruß Daniel
_________________
©Qubit
Back to top
View user's profile Send private message
cyclohexan
n00b
n00b


Joined: 11 Nov 2004
Posts: 50
Location: Germany

PostPosted: Wed Nov 07, 2007 7:24 pm    Post subject: Reply with quote

Hi,

wmctrl funktioniert wunderbar.
Vielen Dank!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum