You are viewing leonerd

LeoNerd [entries|archive|friends|userinfo]
LeoNerd

[ website | My Website ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

(no subject) [Oct. 2nd, 2008|11:13 am]
There's a meme going around:

> 17. Who do you think would make a better president? McCain or Obama?

At one time it was a contest between a black guy, a woman, and an old guy. Surely we should instead settle on some kind of compromise choice and pick all three - I'd vote Oprah, but at only 54, is she really old enough?
Link2 comments|Leave a comment

EF travel plans [Aug. 18th, 2008|12:57 pm]
[Tags|, ]

In case anyone needs to know, here's what I'm doing:

Outbound:

  Wed, 27 Aug 1hr 45min Total time

  Depart London British Airways 902 Economy | Boeing 767
  1hr 45min

  07:25 Heathrow airport (LHR)

  Arrive Frankfurt
  10:10 Frankfurt Int'l Airport (FRA)

Return:

  Mon, 1 Sep 1hr 40min Total time

  Depart Frankfurt British Airways 909 Economy | Airbus A319
  1hr 40min

  17:10 Frankfurt Int'l Airport (FRA)

  Arrive London
  17:50 Heathrow airport (LHR)

I won't leave a mobile number here on LJ, but if anyone thinks they need it and doesn't have it, find me on IRC/MSN/AIM/ICQ, or (recursively) find someone else who knows me.
Link1 comment|Leave a comment

Cheating on the 4th of July [Jul. 31st, 2008|06:13 pm]
[Tags|, ]
[Current Music |one of the above]

A long time ago I wrote a list of songs I have with numbers in their title. I still don't exactly have a "four".. but I wonder if anyone thinks U2's 4th Of July is cheating
LinkLeave a comment

Furry Survey [May. 26th, 2008|02:39 pm]
[Tags|]
[Current Location |Home]

I don't usually do memes, but I think this one is worthy enough of note.

It's a furry survey. An attempt to get some accurate numbers on statistics and things. No idea how well it will work, but likely the result will be better if more people respond. And yes I'm aware of the inherent self-selection towards LJ-users that'll come out in the result as a consequence of posting it on LJ. So don't point that out to me :P

survey banner
Link3 comments|Leave a comment

Back online [Apr. 11th, 2008|01:31 am]
[Tags|]

We've now got our connection up and working again at home.

Move is going well too - starting to unpack things and find places to put them. More to go yet though...
Link3 comments|Leave a comment

Moving house [Mar. 28th, 2008|11:06 am]
A quick note to the effect that we're moving house. New place doesn't yet have ADSL set up, so expect not to see me around online too much for the next week or so. Hopefully should have connection up and running again in a week or so...

More detail when we're settled in.. :)
Link5 comments|Leave a comment

Faked geekery [Oct. 25th, 2007|09:12 pm]
[Tags|]
[Current Location |Home as usual]
[Current Mood |contemplativecontemplative]

I've been accused recently of not posting to my journal enough. If truth be told, it's largely because I don't think I ever do anything, or have anything to say, that would be of wider interest to many people at once. So perhaps I'll start writing some more specific things and see what the reaction is.

I've recently been writing a program that tries to fulfil a rather old nagging thought in my head; that of fairly arbitrary event binding. We have ever-growing numbers of programs that try to bind various events to various actions. Most people use a window manager to bind hotkeys to start new programs. Then there's cron, that binds certain times of the day/week/month/year to commands. I happen to run imwheel to bind the thumb buttons on my mouse to send keyboard events to programs that wouldn't otherwise pay attention to these mouse buttons. Cough firefox YES I AM LOOKING AT YOU.

Individually, these are all moderately nice programs. But taken all together, they start to feel a little underpowered. For example, imwheel can be sensitive to the title/class/role of the window you clicked the mouse button on, but it can only listen for mouse buttons. Window manager or xbindkeys can listen for keypress events, but aren't sensitive to the window it was on. And so on... Then there's the annoyance that almost all programs simply do a fork()/exec() to run some external command - this makes them flexible, if inefficient. And occasionally there's persistence tricks you'd like to do but can't - e.g. easily find a way to have a combined mute/unmute button for sound.

So I started thinking of how I can do this generically; a program that can just listen for "events", and respond with "actions", being sensitive to some sort of "condition". So far, I have an implementation that waits on X11 key/mousebutton presses, ACPI events or raw evdev events. I'm planning joystick and wiimote support too, for things I want. On the action side, so far just command execution, mpd control, and printing of messages to stdout (great for debug testing). These are all implemented in little plugins, so it's very easy to add just about anything.

My current struggle, leading on to the subject of this post, concerns the delivery of faked X11 input events. There's basically two ways to do this, neither seem very satisfactory to me.

The XTEST extension

This rather-oddly named extension was originally designed for testing X servers without real user input. The extension has the ability to inject faked keyboard input and mouse press or motion events programmatically. The upside of this approach is that generally it works with little effort. The downside being it doesn't have any context - keyboard events are just generated as if the user typed them; they can't be directed to some particular window or other, for example. Furthermore, should I wish to send e.g. a Ctrl-A to a program, I'd have to fake pressing the Ctrl key, then A, then releasing them both.

XSendEvent

This X11 call can be used to deliver any event to any window. It's more complex to work out how to use than XTEST; for example it needs an entire valid event being sent. This event would need to include the absolute and window-relative position of the mouse cursor, and other details. It can be sent to a specific window (likely the one under the mouse at the time; though this might be "tricky" if this action was triggered by some non-X11 event). It can also be given a specific set of state bits, so no tricky hackery of Ctrl keys just to send those. The downside though is it's much more complex to send, and not quite guaranteed to work, since the delivered event will be marked as being faked by XSendEvent rather than natively generated by the server from user input. There may be some programs that would ignore it in this case.

So, those are my options. Neither quite seems right, for the reasons outlined. I'm not sure which of these methods I ought to use; or maybe if in fact I should allow a choice of either in config - each action could specify which one to use. But is that just my "any difficult decisions should just be deferred to the user by config" kicking in? Is this a good response though?

Link3 comments|Leave a comment

Tearful lyrics [Sep. 27th, 2007|10:02 pm]
[Tags|]
[Current Location |Home]
[Current Mood |tearful]
[Current Music |Mark Knopfler and Emmylou Harris - All The Roadrunning]

I'd like to know sometime why song lyrics often make me cry a little bit, for no particular reason I've worked out.
Link3 comments|Leave a comment

Music by Numbers [Jul. 19th, 2007|12:19 pm]
[Tags|, ]
[Current Music |Various]

Mark Knopfler - One More Matineé
Savage Garden - Two Beds and a Coffee Machine
Lightning Seeds - Three Lions
*grr*
Out Of The Blue - Five Colours
Dire Straits - Six Blade Knife
Queen - The Seven Seas of Rhye
David Bowie - Eight Line Poem
Aerosmith - Nine Lives
Celine Dion - Ten Days

How disappointing - I seem to have no "four"s at all. Can anyone suggest me something I should get?

Also - can anyone else do any better? It seems much harder beyond ten - nobody seems to write many songs about larger numbers.
Link12 comments|Leave a comment

Mathematical amusement [Apr. 23rd, 2007|10:43 pm]
[Tags|, , ]
[Current Mood |amusedamused]

While waiting for the tube train this evening, it suddenly struck me as amusing from a mathematical perspective, the way it is advertised as CIRCLE LINE. As if to compound my observation, the next station we stopped at was "Sloane Square; Circle Line".

I had to smile at that one.
Link7 comments|Leave a comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]