9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] a very silly program
@ 2010-06-04 15:34 ron minnich
  2010-06-04 15:55 ` Francisco J Ballesteros
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: ron minnich @ 2010-06-04 15:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

http://bitbucket.org/rminnich/plan9tools/src/tip/catmouse.c

I sort of wanted to learn what it would take to interpose a program
between /dev/mouse and something else. Now I've learned and this
clunker is the result. It's sort of amusing.

to test, get thee to a window and:
8.catmouse
rio

obviously the map() function could use some improvement :-)

ron



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 15:34 [9fans] a very silly program ron minnich
@ 2010-06-04 15:55 ` Francisco J Ballesteros
  2010-06-04 16:42   ` ron minnich
  2010-06-04 19:02 ` Skip Tavakkolian
  2010-06-04 22:06 ` Federico G. Benavento
  2 siblings, 1 reply; 16+ messages in thread
From: Francisco J Ballesteros @ 2010-06-04 15:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

mousefs is another example.
I think I placed it in sources.
It's used here to redirect mice to other Plan 9s.


On Fri, Jun 4, 2010 at 5:34 PM, ron minnich <rminnich@gmail.com> wrote:
> http://bitbucket.org/rminnich/plan9tools/src/tip/catmouse.c
>
> I sort of wanted to learn what it would take to interpose a program
> between /dev/mouse and something else. Now I've learned and this
> clunker is the result. It's sort of amusing.
>
> to test, get thee to a window and:
> 8.catmouse
> rio
>
> obviously the map() function could use some improvement :-)
>
> ron
>
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 15:55 ` Francisco J Ballesteros
@ 2010-06-04 16:42   ` ron minnich
  2010-06-04 17:04     ` David Leimbach
  0 siblings, 1 reply; 16+ messages in thread
From: ron minnich @ 2010-06-04 16:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Jun 4, 2010 at 8:55 AM, Francisco J Ballesteros <nemo@lsub.org> wrote:
> mousefs is another example.
> I think I placed it in sources.
> It's used here to redirect mice to other Plan 9s.

That's how it always works, I write something and found out someone
else wrote it :-)

but catmouse is a bit psycho, you'll see if you use it.

ron



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 16:42   ` ron minnich
@ 2010-06-04 17:04     ` David Leimbach
  2010-06-04 18:13       ` ron minnich
  2010-06-04 20:22       ` EBo
  0 siblings, 2 replies; 16+ messages in thread
From: David Leimbach @ 2010-06-04 17:04 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

On Fri, Jun 4, 2010 at 9:42 AM, ron minnich <rminnich@gmail.com> wrote:

> On Fri, Jun 4, 2010 at 8:55 AM, Francisco J Ballesteros <nemo@lsub.org>
> wrote:
> > mousefs is another example.
> > I think I placed it in sources.
> > It's used here to redirect mice to other Plan 9s.
>
> That's how it always works, I write something and found out someone
> else wrote it :-)
>
> but catmouse is a bit psycho, you'll see if you use it.
>
> ron
>
> I'm not sure what it's supposed to do... I tried it with 9vx and it just
made my mouse unresponsive :-)  I guess I could read the rest of the
source...

[-- Attachment #2: Type: text/html, Size: 958 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 17:04     ` David Leimbach
@ 2010-06-04 18:13       ` ron minnich
  2010-06-04 18:16         ` David Leimbach
  2010-06-04 20:22       ` EBo
  1 sibling, 1 reply; 16+ messages in thread
From: ron minnich @ 2010-06-04 18:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

well maybe it's broke. What it's supposed to do is make it impossible
to put your mouse in the middle of the window ... works in 9vx

ron



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 18:13       ` ron minnich
@ 2010-06-04 18:16         ` David Leimbach
  0 siblings, 0 replies; 16+ messages in thread
From: David Leimbach @ 2010-06-04 18:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

Huh... I'll play around with it and see what's up :-)

On Fri, Jun 4, 2010 at 11:13 AM, ron minnich <rminnich@gmail.com> wrote:

> well maybe it's broke. What it's supposed to do is make it impossible
> to put your mouse in the middle of the window ... works in 9vx
>
> ron
>
>

[-- Attachment #2: Type: text/html, Size: 570 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 15:34 [9fans] a very silly program ron minnich
  2010-06-04 15:55 ` Francisco J Ballesteros
@ 2010-06-04 19:02 ` Skip Tavakkolian
  2010-06-04 19:09   ` erik quanstrom
  2010-06-04 22:06 ` Federico G. Benavento
  2 siblings, 1 reply; 16+ messages in thread
From: Skip Tavakkolian @ 2010-06-04 19:02 UTC (permalink / raw)
  To: 9fans

there's also /n/sources/contrib/fst/tippi.c

i am adding a feature to tippi to create a thumbnail of /dev/screen
and mark the mouse location in the thumbnail.  i had planned to use
resample to create it but it is slow and doesn't seem to correct for
color (color is intensified).  there might be a better way too.

-Skip

> http://bitbucket.org/rminnich/plan9tools/src/tip/catmouse.c
>
> I sort of wanted to learn what it would take to interpose a program
> between /dev/mouse and something else. Now I've learned and this
> clunker is the result. It's sort of amusing.
>
> to test, get thee to a window and:
> 8.catmouse
> rio
>
> obviously the map() function could use some improvement :-)
>
> ron




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 19:02 ` Skip Tavakkolian
@ 2010-06-04 19:09   ` erik quanstrom
  0 siblings, 0 replies; 16+ messages in thread
From: erik quanstrom @ 2010-06-04 19:09 UTC (permalink / raw)
  To: 9fans

> i am adding a feature to tippi to create a thumbnail of /dev/screen
> and mark the mouse location in the thumbnail.  i had planned to use
> resample to create it but it is slow and doesn't seem to correct for
> color (color is intensified).  there might be a better way too.

i've been using richard miller's resize(1) when speed
is more important than accuracy.  i modified it to
make the arguments compatable with resample.

- erik



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 17:04     ` David Leimbach
  2010-06-04 18:13       ` ron minnich
@ 2010-06-04 20:22       ` EBo
  2010-06-04 20:31         ` ron minnich
  1 sibling, 1 reply; 16+ messages in thread
From: EBo @ 2010-06-04 20:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, 4 Jun 2010 10:04:34 -0700, David Leimbach <leimy2k@gmail.com>
wrote:
> On Fri, Jun 4, 2010 at 9:42 AM, ron minnich <rminnich@gmail.com> wrote:
>
>> On Fri, Jun 4, 2010 at 8:55 AM, Francisco J Ballesteros <nemo@lsub.org>
>> wrote:
>> > mousefs is another example.
>> > I think I placed it in sources.
>> > It's used here to redirect mice to other Plan 9s.
>>
>> That's how it always works, I write something and found out someone
>> else wrote it :-)
>>
>> but catmouse is a bit psycho, you'll see if you use it.
>>
>> ron
>>
>> I'm not sure what it's supposed to do... I tried it with 9vx and it
just
> made my mouse unresponsive :-)  I guess I could read the rest of the
> source...

this one got me too at first.  Start 9vx, etc., open a window (with rio
running), run catmouse, and in the same window run rio again.

When I first tried this I started up 9vx without rio, ran catmouse at a
windowless command prompt, and then ran rio and it did not work correctly.
Maybe this is not what Ron intended, but this is what worked for me...

  EBo --




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 20:22       ` EBo
@ 2010-06-04 20:31         ` ron minnich
  2010-06-04 20:39           ` EBo
  2010-06-05 16:18           ` Johnny
  0 siblings, 2 replies; 16+ messages in thread
From: ron minnich @ 2010-06-04 20:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Jun 4, 2010 at 1:22 PM, EBo <ebo@sandien.com> wrote:

> When I first tried this I started up 9vx without rio, ran catmouse at a
> windowless command prompt, and then ran rio and it did not work correctly.
> Maybe this is not what Ron intended, but this is what worked for me...

bonus points for why that did not work ;-)

It's a silly program, mainly I mention it for anyone else who might
want to do something real ...

ron



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 20:31         ` ron minnich
@ 2010-06-04 20:39           ` EBo
  2010-06-04 21:01             ` ron minnich
  2010-06-05 16:18           ` Johnny
  1 sibling, 1 reply; 16+ messages in thread
From: EBo @ 2010-06-04 20:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


>> When I first tried this I started up 9vx without rio, ran catmouse at a
>> windowless command prompt, and then ran rio and it did not work
>> correctly.
>> Maybe this is not what Ron intended, but this is what worked for me...
>
> bonus points for why that did not work ;-)

Well, without reading the code I would guess that you do not have a device
(or service) connected to the mouse until a window manager is started.  It
is also even  likely a problem with what is set in the namespaces.


  EBo --




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 20:39           ` EBo
@ 2010-06-04 21:01             ` ron minnich
  2010-06-04 21:42               ` EBo
  0 siblings, 1 reply; 16+ messages in thread
From: ron minnich @ 2010-06-04 21:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Jun 4, 2010 at 1:39 PM, EBo <ebo@sandien.com> wrote:
>
>>> When I first tried this I started up 9vx without rio, ran catmouse at a
>>> windowless command prompt, and then ran rio and it did not work
>>> correctly.
>>> Maybe this is not what Ron intended, but this is what worked for me...
>>
>> bonus points for why that did not work ;-)
>
> Well, without reading the code I would guess that you do not have a device
> (or service) connected to the mouse until a window manager is started.  It
> is also even  likely a problem with what is set in the namespaces.

well, can't I get any of you folks to figure it out using ratrace :-)

ron



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 21:01             ` ron minnich
@ 2010-06-04 21:42               ` EBo
  0 siblings, 0 replies; 16+ messages in thread
From: EBo @ 2010-06-04 21:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


>> Well, without reading the code I would guess that you do not have a
>> device
>> (or service) connected to the mouse until a window manager is started.
>>  It
>> is also even  likely a problem with what is set in the namespaces.
> 
> well, can't I get any of you folks to figure it out using ratrace :-)

you can when I'm not focused on other things (unless figuring catmouse out
is important for my GSoC project, on the other hand learning ratrace would
be useful)...

  EBo --



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 15:34 [9fans] a very silly program ron minnich
  2010-06-04 15:55 ` Francisco J Ballesteros
  2010-06-04 19:02 ` Skip Tavakkolian
@ 2010-06-04 22:06 ` Federico G. Benavento
  2010-06-04 22:11   ` ron minnich
  2 siblings, 1 reply; 16+ messages in thread
From: Federico G. Benavento @ 2010-06-04 22:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

what about just using pipefile(1) and a filter
like accupoint(1) does

On Fri, Jun 4, 2010 at 12:34 PM, ron minnich <rminnich@gmail.com> wrote:
> http://bitbucket.org/rminnich/plan9tools/src/tip/catmouse.c
>
> I sort of wanted to learn what it would take to interpose a program
> between /dev/mouse and something else. Now I've learned and this
> clunker is the result. It's sort of amusing.
>
> to test, get thee to a window and:
> 8.catmouse
> rio
>
> obviously the map() function could use some improvement :-)
>
> ron
>
>



--
Federico G. Benavento



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 22:06 ` Federico G. Benavento
@ 2010-06-04 22:11   ` ron minnich
  0 siblings, 0 replies; 16+ messages in thread
From: ron minnich @ 2010-06-04 22:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Jun 4, 2010 at 3:06 PM, Federico G. Benavento
<benavento@gmail.com> wrote:
> what about just using pipefile(1) and a filter
> like accupoint(1) does

it was partly just to get my brain to get the hang of what it takes to
interpose a trivial file system between /dev/mouse and rio.

ron



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] a very silly program
  2010-06-04 20:31         ` ron minnich
  2010-06-04 20:39           ` EBo
@ 2010-06-05 16:18           ` Johnny
  1 sibling, 0 replies; 16+ messages in thread
From: Johnny @ 2010-06-05 16:18 UTC (permalink / raw)
  To: 9fans

Hello,
just wanted to know if i got my logic right ;)


On Fri, 4 Jun 2010 13:31:57 -0700
ron minnich <rminnich@gmail.com> wrote:

> On Fri, Jun 4, 2010 at 1:22 PM, EBo <ebo@sandien.com> wrote:
>
> > When I first tried this I started up 9vx without rio, ran catmouse
> > at a windowless command prompt, and then ran rio and it did not
> > work correctly. Maybe this is not what Ron intended, but this is
> > what worked for me...
>
> bonus points for why that did not work ;-)

Because rio multiplexes the mouse, so if you open the mouse before rio
starts it won't be multiplexed, so rio won't be able to access it?

>
> It's a silly program, mainly I mention it for anyone else who might
> want to do something real ...
>
> ron
>

Thanks,

John



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-06-05 16:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-04 15:34 [9fans] a very silly program ron minnich
2010-06-04 15:55 ` Francisco J Ballesteros
2010-06-04 16:42   ` ron minnich
2010-06-04 17:04     ` David Leimbach
2010-06-04 18:13       ` ron minnich
2010-06-04 18:16         ` David Leimbach
2010-06-04 20:22       ` EBo
2010-06-04 20:31         ` ron minnich
2010-06-04 20:39           ` EBo
2010-06-04 21:01             ` ron minnich
2010-06-04 21:42               ` EBo
2010-06-05 16:18           ` Johnny
2010-06-04 19:02 ` Skip Tavakkolian
2010-06-04 19:09   ` erik quanstrom
2010-06-04 22:06 ` Federico G. Benavento
2010-06-04 22:11   ` ron minnich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).