Thanks for the reply. The thing is I am trying to exclude some windows,
not include.
-Joon
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system
python version is 2.7.2.
Can you please show me what did you use to exclude gedit? Maybe I can try
your regex.
-Joon
Thank you very much for your help.
I just tried gedit as well and gedit case it seems to be working for me as
well.
And please don't install Virtualbox OSE because that was the example chris
was using,
and I'm not having trouble with that.
Let me give you one of my example. I want to exclude the LyX window.
My LyX window's title is
LyX: ~/workspace/newfile1.lyx
And whatever I try, I cannot make autokey to exclude this.
For example,
^((?!LyX.*).)*$
does not work.
-Joon
Thanks again for your reply. I tried the following:
title = window.get_active_title()
if title.find('LyX:') == -1:
keyboard.send_keys('test string')
with some abbreviation. I just used str.find() instead of importing re
module.
It seems to be working, but strangely within 2 or 3 tries, autokey freezes.
I don't know what is going on, but when I run autokey from the terminal to
see any messages,
when autokey freezes, autokey types the 'test string' in the TERMINAL
window instead of
whatever window I had evoked the script.
Are you having any autokey freezing problem with the script?
-Joon
So this is the log. I grabbed only part where it happens. I tried this
with 'opera.OperaNext' window. I have a script with
Abbreviations: \a
"Omit trigger character" is the only thing checked
and the script content is:
title = window.get_active_title()
if title.find('LyX:') == -1:
keyboard.send_keys('lpha')
I tried several times, and it worked, until suddenly autokey automatically
changes the window to 'terminator.Terminator' and then just hangs.
So whatever I do, after the last two lines of the log, nothing happens. No
error message, anything.
I haven't done the livescreen thing yet but I will try to do that when I
have time. Thanks a lot for your help!
-Joon
2012-01-22 14:48:31,554 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:31,557 DEBUG - service - Input stack at end of
handle_keypress: [' ', ' ', '\n', '\n']
2012-01-22 14:48:31,887 DEBUG - service - Raw key: u'\\', modifiers: [],
Key: \
2012-01-22 14:48:31,887 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:31,887 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:31,889 DEBUG - service - Input stack at end of
handle_keypress: [' ', ' ', '\n', '\n', u'\\']
2012-01-22 14:48:32,007 DEBUG - service - Raw key: u'a', modifiers: [],
Key: a
2012-01-22 14:48:32,007 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:32,007 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:32,009 DEBUG - service - Input stack at end of
handle_keypress: [' ', ' ', '\n', '\n', u'\\', u'a']
2012-01-22 14:48:32,159 DEBUG - service - Raw key: u' ', modifiers: [],
Key:
2012-01-22 14:48:32,160 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:32,160 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:32,161 DEBUG - service - Script runner executing:
Script('alpha')
2012-01-22 14:48:32,161 DEBUG - service - Input stack at end of
handle_keypress: []
2012-01-22 14:48:32,161 DEBUG - interface - Send special key:
['<backspace>']
2012-01-22 14:48:32,170 DEBUG - service - Ignored locking error in
handle_keypress
2012-01-22 14:48:32,171 DEBUG - iomediator - Send via event interface
2012-01-22 14:48:32,178 DEBUG - interface - Sending string: u'lpha'
2012-01-22 14:48:32,671 DEBUG - service - Raw key: u' ', modifiers: [],
Key:
2012-01-22 14:48:32,671 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:32,673 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:32,675 DEBUG - service - Input stack at end of
handle_keypress: [' ']
2012-01-22 14:48:33,000 DEBUG - service - Raw key: u'\\', modifiers: [],
Key: \
2012-01-22 14:48:33,001 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:33,001 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:33,003 DEBUG - service - Input stack at end of
handle_keypress: [' ', u'\\']
2012-01-22 14:48:33,071 DEBUG - service - Raw key: u'a', modifiers: [],
Key: a
2012-01-22 14:48:33,071 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:33,071 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:33,073 DEBUG - service - Input stack at end of
handle_keypress: [' ', u'\\', u'a']
2012-01-22 14:48:33,167 DEBUG - service - Raw key: u' ', modifiers: [],
Key:
2012-01-22 14:48:33,167 DEBUG - service - Window visible title: u'Re:
window filter exclusion does not work - Opera Next', Window class:
'opera.OperaNext'
2012-01-22 14:48:33,167 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:33,168 DEBUG - service - Input stack at end of
handle_keypress: []
2012-01-22 14:48:33,168 DEBUG - service - Ignored locking error in
handle_keypress
2012-01-22 14:48:33,168 DEBUG - service - Script runner executing:
Script('alpha')
2012-01-22 14:48:33,169 DEBUG - interface - Send special key:
['<backspace>']
2012-01-22 14:48:33,178 DEBUG - iomediator - Send via event interface
2012-01-22 14:48:37,022 DEBUG - interface - Sending string: u'lpha'
2012-01-22 14:48:37,025 DEBUG - service - Raw key: u'\\', modifiers: [],
Key: \
2012-01-22 14:48:37,026 DEBUG - service - Window visible title:
u'autokey-gtk -l > autokeyerror.log', Window class: 'terminator.Terminator'
2012-01-22 14:48:37,026 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:37,028 DEBUG - service - Input stack at end of
handle_keypress: [u'\\']
2012-01-22 14:48:37,030 DEBUG - service - Raw key: u'a', modifiers: [],
Key: a
2012-01-22 14:48:37,030 DEBUG - service - Window visible title:
u'autokey-gtk -l > autokeyerror.log', Window class: 'terminator.Terminator'
2012-01-22 14:48:37,030 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:37,032 DEBUG - service - Input stack at end of
handle_keypress: [u'\\', u'a']
2012-01-22 14:48:37,135 DEBUG - service - Raw key: u' ', modifiers: [],
Key:
2012-01-22 14:48:37,136 DEBUG - service - Window visible title:
u'joon@linux-0sd0: ~/sources/Gnome-Pie', Window class:
'terminator.Terminator'
2012-01-22 14:48:37,136 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:37,138 DEBUG - service - Input stack at end of
handle_keypress: []
2012-01-22 14:48:37,138 DEBUG - service - Ignored locking error in
handle_keypress
2012-01-22 14:48:37,138 DEBUG - service - Script runner executing:
Script('alpha')
2012-01-22 14:48:37,160 DEBUG - iomediator - Send via event interface
>
> On Jan 22, 4:09 pm, uj <ujih...@gmail.com> wrote:
>> I personally changed the line 271 to
>>
>> return r.match(windowInfo[1])
>>
>> to only check the window class, and I specified keywords only about
>> window class. It worked for me.
>>
It worked like a charm. Thanks!
>>
>> > This issue is basically caused by the asymmetricity of matching/
>> > unmatching. I propose that autokey provides negate option in the
>> > Window filtering.
>>
+1