 Talk we have for you now is Daniel Stone, yes it's pretty much like the title I had in the thing kind of Linux input from the bottom to the top, Daniel works at Calabra in the UK, no he's in from Melbourne So no longer from Melbourne, yeah No longer from Bendigo Daniel is famous for wearing shorts and health-sinking all the time of year It's great to be back in shorts, jeans have been rubbish Oh the weather here is rubbish, I heard it So does this just... Yeah, it's the future Brilliant, it's the future Right, so I was originally planning to give a what we've been doing in input since MPX talk and what we think we should do with it for Wayland and then Peter pointed out that most of what we'd done was multi-touch and he was giving a talk on multi-touch in the main conference which I should have remembered because I was on the papers committee and approved it So if you want to find out what this talk was supposed to be you should go see Peter sometime on Wednesday apparently Right, so instead we've got a kind of 10,000 foot overview of input basically from the kernel down to the application layer going through most of what we do with it in X which is quite a lot and entirely unpleasant and then what the clients do with it which is wholly unpleasant and then hopefully what we'll do with it in the future to make it more pleasant Right, so broadly speaking it looks like the one on the left assuming you're looking at Q fairly simple hard to go wrong and then turns into a key code that's what we get from the kernel is 16 was pressed which isn't particularly useful what you want is something like number three where you've got lowercase and uppercase Q if you don't want to be shouting at people the whole time and what you want if you're a crazy bilingual French enthusiast is the one on the right where you can press magic keys and then your keyboard becomes really offensive Worst Right, so the very basic terminology key code it's just a numeric identifier for a single physical key A key sim is a single character such as uppercase Q, circumflex whatever we have tens of thousands more lots of them overlapping and pointless modifier all it does is affects what other keys do shift pretty useless on its own kind of handy in combination with Q and yeah, so we look at each key as Let's try that again but more constantly Right, so we just look at every key as having a set of symbols indexed by the level so shift bumps your level up by one alternate group might bump it up by two or so and so on and so forth and then a group is all of these what? a layout is all of these things mashed together into a coherent key map pointers are really quite easy you've got your touch screens, tablets and such that just tell you it's moved to this coordinate there's nothing to go wrong relative devices like classic mice tell you you move three pixels to the right and one pixel down it's not too difficult but if you want to do them right you need to do acceleration you need to keep all your state around so it's a bit more involved but still not too bad the weird ones no one likes are touch pads because they give you absolute coordinates telling you exactly where you've pressed on the touch pad but you really want for that to be relative unless you want your touch pad mapped to your entire screen so they're fairly unpleasant and I don't touch synaptics what are you doing about it? Good man, delegation don't delegate it to me or could we? Right, so once key events have come through from the kernel to X we don't really do a hell of a lot with them there's a couple of accessibility tweaks we do to them when we're processing them so one of them is sticky keys where if you can't press CTRL and S at the same time we let you fake it by pressing CTRL then pressing X slow keys, if you can't lift your finger up quickly enough we can kill repeat for you and bounce keys if you have a habit of hitting the same key multiple times we'll suppress that as well Oh, very simple Right, so for pointer events we do a fair bit more to them we accelerate the pointer so it doesn't take you a year to move from the left hand to the right hand side of your screen and we tend to do it quite badly so it takes you about a second but that's neither here nor there Right, so for touch pads we do a lot more complex processing you have to deal with tap to click you have to deal with multi-finger taps and multi-finger scrolling you have to filter the life out of it because they're useless you have to do palm detection so you don't accidentally trigger touch pad taps every time you're typing and we don't do it very well because every time I'm typing I type into another window but we should be better and most touch screens need some filtering to make them less horrific Right, so once we've processed our events we have to start delivering them which is where it gets brutally unpleasant if we just drop them on the floor everyone's life would be a lot easier so the really easy, simple way is just deliver key and mouse events to the window under the pointer but that falls apart fairly quickly because if you want to have a pop-up menu then you want all the keyboard events regardless of where your cursor is if you want a screen saver for instance you want all the events drag and drop requires you want to own it from your application and not just have the pointer disappear once you've left the window Alt dragging, the window manager handles that for you so again we need something more complex and hotkeys as well, such as brightness that'd be fairly pointless if they just went to your browser so someone who I'd very much like to meet and say various pleasantries to came up with the concept of grabs where it's a way to steal all the events from particular devices for you and you alone and there are two types of grabs one is when this key is pressed or this button or so on and so forth just tell me and leave everyone else out of it and the other one is active grabs which are just give me all the events from this device until I tell you not to so they're really handy and they work quite well so yeah, you have GNOME settings demon will handle your brightness hotkeys for you no one else has to care about them pop-up menus, they only work because they grab the entire keyboard screensavers, kind of handy that they grab so you're not just banging your password into IRC not that that's ever happened to me yeah, yeah, I think it was one of the ones that could log into free desktop as well yeah, there was a bug where you've either leaked fds so the screensaver