[conspire] more re touchscreen / tablet style scrolling and touchpad manipulation

Tony Godshall togo at of.net
Thu Apr 18 15:07:23 PDT 2013


oh my.
awk syntax argued to be better than if(){}else{}?
// better than m{} ?
And what if you have to match paths, hmmm?  do you enjoy slanty-stick-land?

but good stuff, nick, it educates, even if we disagree

I've long been convinced perl is a better awk than awk, a better sed
than sed, and a better grep than grep.  Doesn't mean you should use it
for actual programming tho.

Oh, and re the four year old with zero touchscreen experience, I'm
sure you meant the opposite of what you wrote- the wheel rolling in
the direction of the thing itself, not the viewport to the thing.

((an odd aside- chromeos calls the opposite scrolling "australian"))

so, anyhow, now I'm trying to fix touch sensitivity- this touchpad is
so close to spacebar and it's even raised up a mm or two- it's almost
like they designed it for thumbing to be an issue.  of course in the
chromos side, it's less touchy so I'm sure it'll be tolerable if tweak
some settings.

here's a good page about manipulating xinput...

http://www.mepis.org/docs/en/index.php?title=Configuring_the_touchpad_with_xinput


On Wed, Apr 17, 2013 at 1:55 AM, Nick Moffitt <nick at zork.net> wrote:
> Tony Godshall:
>> It scrolls backwards!?  Yup, it's called "Natural Scrolling" and it
>> seems wrong wrong wrong.  Until you get a laptop with a touch-screen.
>
> I have a four-year-old daughter, and her first instinct with a mouse's
> scroll-wheel is that it should turn in the direction the viewport moves,
> rather than in the direction of travel within the pane.  To her,
> "Natural Scrolling" is the most natural option even without a
> touchscreen.
>
>> for id in $(xinput list|perl -ne
>> 'if(m{XTEST}){}elsif(m{id=([0-9]+).*slave.*pointer}){print "$1\n"}');
>> do xinput set-button-map $id $(xinput get-button-map $id|perl -pe 's{
>> 4 5 }{ 5 4 }'); done
>>
>> If any folks on the list would like a breakdown of that, let me know.
>
> As a recovered 1990s Perl 5.005 refugee (Thank you, Python!  Thank you,
> awk!), I feel duty-bound to translate this to awk:
>
>     xinput list | \
>     awk -F "[\t=]" '$1 !~ /XTEST/ && $4 ~ /slave.+pointer/ {print $3}' | \
>     while read id
>     do
>       xinput set-button-map $id $(xinput get-button-map $id | sed 's/ 4 5/ 5 4/')
>     done
>
> xinput uses tab-delimited output, but has a single = in the id field, so
> I used the -F parameter to split on both tabs and =.
>
> We filter out the "Virtual core XTEST" objects with a negative match on
> XTEST in the first column, then match for "slave  pointer" (or similar)
> in the third column.  Note that this is $4 because we also split on = to
> get a pure ID integer in our $3 column variable, which we print.
>
> Then we use set-button-map on a transformation on get-button-map, and
> this is one of the rare cases where sed is clear enough.  Note also that
> I did not require a space after the 5 in the get output, so this would
> work on devices that have no map for buttons 6 or 7.
>
> Also by switching to a pipe and a while-do loop, I removed one of the
> $() subshells, which I feel aids clarity.
>
> --
> "If, as they say, God spanked the town
> for being over frisky,
> why did He burn the churches down
> and save Hotaling's whisky?" -- 1906 SF Earthquake rhyme
>
> _______________________________________________
> conspire mailing list
> conspire at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/conspire



--
Best Regards.
This is unedited.




More information about the conspire mailing list