You are not logged in.

#1 2014-01-21 21:07:12

sphaso
Member
Registered: 2013-07-15
Posts: 9

xvkbd "cannot convert string to type FontStruct"

Hi,
I'm trying to emulate some keys combinations without much success. Whenever I run xvkbd that's the output:

[sphaso@sphaso ~]$ xvkbd -xsendevent -text "\[F11]"
Warning: Cannot convert string "-*-lucidatypewriter-bold-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1" to type FontStruct

And of course nothing happens.

I've looked far and wide without much success. In the Arch forum I've found:

https://bbs.archlinux.org/viewtopic.php?id=80061
https://bbs.archlinux.org/viewtopic.php?id=119636

but they seem unrelated (see last two lines of their error messages, which are absent from mine).

I wonder if anyone has any clue to point me in the right direction? If so, thanks a lot!

Offline

#2 2014-01-22 11:55:53

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: xvkbd "cannot convert string to type FontStruct"

Have you found this page?
I might be useful.

Here's the full home, for reference: http://homepage3.nifty.com/tsato/xvkbd/

If the FAQ doesn't answer the issue, try running with -debug.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2014-01-22 18:35:11

sphaso
Member
Registered: 2013-07-15
Posts: 9

Re: xvkbd "cannot convert string to type FontStruct"

Hi skanky, thanks for your advice.
I'm actually starting to think that the warning and the failed binding are unrelated. See what happens when I run with -debug:

[sphaso@sphaso ~]$ xvkbd -xsendevent -text "hello" -debug
Warning: Cannot convert string "-*-lucidatypewriter-bold-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1" to type FontStruct
xvkbd (v3.5), compiled Jul 15 2013
xvkbd: found ISO_Level3_Shift at 7th modifier
xvkbd: found Mode_switch at 7th modifier
xvkbd: both ISO_Level3_Shift and Mode_switch found
xvkbd: assuming ISO_Level3_Shift=0x80, Mode_switch=0x2000
SendKeyPressedEvent: focus=0x2400007, key=0x68 (h), shift=0x0
SendKeyPressedEvent: keysym=0x68, keycode=43, shift=0x0
SendKeyPressedEvent: focus=0x2400007, key=0x65 (e), shift=0x0
SendKeyPressedEvent: keysym=0x65, keycode=26, shift=0x0
SendKeyPressedEvent: focus=0x2400007, key=0x6C (l), shift=0x0
SendKeyPressedEvent: keysym=0x6c, keycode=46, shift=0x0
SendKeyPressedEvent: focus=0x2400007, key=0x6C (l), shift=0x0
SendKeyPressedEvent: keysym=0x6c, keycode=46, shift=0x0
SendKeyPressedEvent: focus=0x2400007, key=0x6F (o), shift=0x0
SendKeyPressedEvent: keysym=0x6f, keycode=32, shift=0x0

It seems that xvkbd is sending the correct signals, except nothing happens. In the case of "F11" I was expecting for the window of the terminal to go full screen, but of course it didn't. Am I getting something wrong?

Offline

#4 2014-01-22 21:14:15

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: xvkbd "cannot convert string to type FontStruct"

Yes, I think it is a separate issue.

You should try and use the -window option to direct the event to the right window. See http://homepage3.nifty.com/tsato/xvkbd/#option
It's a bit of a pain that there's no man page and you have to go to a web page to see the options, but it's a helpful website.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2014-01-23 05:43:54

sphaso
Member
Registered: 2013-07-15
Posts: 9

Re: xvkbd "cannot convert string to type FontStruct"

Hi skanky. Using the window option doesn't seem to change much:

(I edited out some parts in which it simply cycles through each window I had opened)

[sphaso@sphaso ~]$ xvkbd -xsendevent -window *terminal* -text "\[F11]" -debug
Warning: Cannot convert string "-*-lucidatypewriter-bold-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1" to type FontStruct
xvkbd (v3.5), compiled Jul 15 2013
...
FindWindow: id=0x1000080
FindWindow: id=0xC11CA3
FindWindow: id=0x2400006 instance="gnome-terminal-server" class="Gnome-terminal" title="sphaso@sphaso:~" [matched]
xvkbd: found ISO_Level3_Shift at 7th modifier
xvkbd: found Mode_switch at 7th modifier
xvkbd: both ISO_Level3_Shift and Mode_switch found
xvkbd: assuming ISO_Level3_Shift=0x80, Mode_switch=0x2000
KeyPressed: key=F11, widget=0
SendKeyPressedEvent: focus=0x2400006, key=0xFFC8 (?), shift=0x0
SendKeyPressedEvent: keysym=0xffc8, keycode=95, shift=0x0
Set input focus to window 0x2400006 (0x2400006)
Set input focus to window 0x2400006 (0x2400006)

The reason I have behind trying to do this is to use voice control. Check out this video https://www.youtube.com/watch?v=e_9Sav14FBc
At 1:42 you can see he's launching these same commands with success. He's using the "-secure" option but it doesn't change anything in my case.

Offline

#6 2014-01-23 05:53:34

sphaso
Member
Registered: 2013-07-15
Posts: 9

Re: xvkbd "cannot convert string to type FontStruct"

Nevermind, I've just read that the terminal doesn't accept xsendevents unless you flag out an option. I switched to xdotool which does the job flawlessly.

Thanks a lot skanky smile

Offline

#7 2014-01-23 10:06:14

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: xvkbd "cannot convert string to type FontStruct"

No problem. That looks quite cool.

smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB