disable right click


Forum: X and Fluxbox
Topic: disable right click
started by: dimos55

Posted by dimos55 on April 07 2004,23:22
I am configuring a kiosk and so far DSL has proven to be a perfect choice for this.  Firefox is completely customizable, and fluxbox is light stable and customizable.

Something I do need to do is prevent people from right clicking (in X).  I could lock this off in just firefox, but I also want to disable right clicking on titlebars or to get the fluxbox menu.  Does anyone have any suggestions?  I have already tried xmodmap to only recognize the first button; but that doesn't work.

Posted by dario on April 08 2004,03:46
I wonder if it could be as easy as having an empty menu file, perhaps you could try it and tell us.
Posted by cbagger01 on April 08 2004,05:46
Instead of disabling right-clicking, why don't you just start XWindows up with out using a Window manager, like Fluxbox.  You can still launch a web browser and specify the window location and size, and people will have a more difficult time messing with your system.
Posted by dimos55 on April 08 2004,18:04
For the empty menu file, that would work (i assume) for the main menu (right-clicking on the desktop).... But I was unable to find the menu file for applications (titlebar specifically).  By right-clicking the titlebar you get a menu that includes iconify,close,kill,etc...; is this menu application specific or general for the window manager?

I did try a setup where I launched mozilla from .xinitrc.  Worked well for the most part; disable the menus the titlebar, etc.  But it had some limitations and problems: I need to allow for a select few popups, ifI dont have a menu (since I'm customizing mozilla to not) and no titlebar... the popups couldn't be closed.  I have no control over the actual code on these pages, otherwise I'd just have a "close" button on the popup.  Another issue is that if mozilla dies; I'd like the system to either restart x and thus mozilla; or currently allow the user to click on a sole desktop icon that launches mozilla.

I would go the route of no wm; if I could handle those 2 problems.  Any suggestions?

Posted by cbagger01 on April 08 2004,23:52
The Desktop icon to restart Mozilla should work correctly if you launch xtdesktop along with Mozilla. Just make sure that there are no other icons besides Mozilla in your xtdesktop user folder.

As for the lack of a Window Manager problems, I don't know the answer but I am sure that you are not the first person who needed a similar embedded/kiosk secure Window Manager.

Try searching google for Linux Window Manager kiosk or similar keywords. I bet  that there is an answer out there somewhere.

Another option would be to use a broswer mode where popups are displayed as "tabbed" windows within the same Browser window instead of havingt them launch as new windows. Opera supports this mode and my guess is that other web browsers (maybe even Mozilla) support it as well.

Good Luck.

Posted by Del on April 09 2004,04:18
Seems like there's some browser out there that lets you to specify what servers are allowed to do popups. Not much help though, because I'm not positive and can't think of a name...
Posted by dimos55 on April 09 2004,05:10
Del:  I dont want to "block" these popups.  The popups arent ads, they are information sites related to the main page.  

cbagger01:  Thanks for the xtdesktop and tabbed browser bits, I will try them.  I have googled extensively, I found a number of very similar projects.  But there were sufficient differences to warrant incorporating the bits that do relate into a new setup.

Anyone know how to reatart x if it exits/dies?

Posted by cbagger01 on April 09 2004,21:41
If X locks up on you, press CTL-ALT-BACKSPACE keys to return to the text mode command prompt.

To restart X server, type 'startx' from the command prompt.

Posted by dimos55 on April 12 2004,06:59
cbagger01:  I know how to restart X... but this is for a kiosk and users will not know how to do this.  I was looking for something along the lines of a background app that can check if x is running, if it isn't it will run startx.  Would that work?  And whats the best way to do this...
Posted by cbagger01 on April 12 2004,17:11
I suppose that you could write a shell script that checks to see if the xvesa or xfbdev process is up and running, execute a restart if if is NOT running, sleep for 30 seconds, and then call itself again in an endless loop.

Some knowledge of shell script programming, the 'ps' command, the 'grep' command, and some kind of 'sleep' command would be required.

Good Luck.

Posted by dimos55 on April 12 2004,18:48
yeah that was kinda what I was thinking.  Will this script use much cpu in running?
Posted by cbagger01 on April 12 2004,23:56
The only way to know for sure is to try it out.  My guess is that CPU usage will be minimal.  RAM usage on an older computer (say 16-32MB RAM systems) could be an issue because each bash session is over 1MB of RAM.  But for a 64MB RAM or higher computer I would guess that it would be just fine.
Posted by Grim on April 13 2004,07:29
For a windowmanager, I'd suggest either < Ratpoison > or < Ion >. I don't think ratpoison uses the mouse at all (I could be wrong), and ion doesn't rely on it heavily, which is good because you've mostly got the right-click menu gone right there.  Both are heavily customizable and both have minimum window decorations.  And I believe both use fewer resources than fluxbox (don't hold me to that).  

Quote
I was looking for something along the lines of a background app that can check if x is running, if it isn't it will run startx.  Would that work?  And whats the best way to do this...


Perl to the rescue...

Code Sample
#!/usr/bin/perl
$x=0;
while ($x<1 ) {
@xrunnin=`ps aux`;
@xrunnin=grep(/startx/,@xrunnin);
$a=@xrunnin;
if ($a <2) {
system (" startx&");
}
sleep 3;
}


Save this out as, I dunno, checktoseeifXisrunning.pl.  It really needs to execute before X starts.  If it starts as a child process of the X session, then whenever X dies so will the script.  

You will need to modify some existing scripts to get this to run before X and, right off the top of my head, I can't think of what they might be.  Maybe if you ask John or Roberts nicely and promise 'em a pony, they can point you in the right direction.

Anyways, this script is set up to check to see if X is running every 3 seconds.  If you want to wait longer change the 3 after sleep to however many seconds you want.

It doesn't impact system resources (not that I could discern at any rate) and could be incorporated into your startup scripts.

It's a really ugly hack but I'm sure now that I've shown a little effort, the Perl guru's will come out of the woodwork to make me look bad.  (Where have they been all this time?)

Posted by dimos55 on April 14 2004,18:46
I haven't had a chance to try anything yet... we may be scrapping the initial configuration.  At least I think we should... since the hardware is complete crap.  But then of course thinking is expressly forbidden in my job description.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.