<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>david stoker's blog &#187; Projects</title>
	<atom:link href="http://www.davidstoker.org/blog/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidstoker.org/blog</link>
	<description>living life to the full</description>
	<lastBuildDate>Sat, 02 May 2009 17:33:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Building a Kiosk With Firefox Part 1</title>
		<link>http://www.davidstoker.org/blog/2008/05/27/building-a-kiosk-with-firefox-part-1/</link>
		<comments>http://www.davidstoker.org/blog/2008/05/27/building-a-kiosk-with-firefox-part-1/#comments</comments>
		<pubDate>Tue, 27 May 2008 23:59:27 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[AutoHotKey]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Kiosk]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[R-Kiosk]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://davidstoker.org/blog/?p=11</guid>
		<description><![CDATA[Well, summer started a couple weeks ago and I started working as a PC Support Specialist again! As a part of my first week of work I started work on re-doing 18 Dell PCs that are set up in a &#8220;museum&#8221; type setting. These PCs have a variety of interactive Flash applications and websites that [...]]]></description>
			<content:encoded><![CDATA[<p>Well, summer started a couple weeks ago and I started working as a PC Support Specialist again! As a part of my first week of work I started work on re-doing 18 Dell PCs that are set up in a &#8220;museum&#8221; type setting. These PCs have a variety of interactive Flash applications and websites that visitors can use. Naturally, these PCs need to be &#8220;locked down&#8221; as much as possible so that people can&#8217;t just press CTRL-ALT-DEL or minimize the browser window and mess around with the computer. These computers were not set up very well initially and there have been plenty of instances of people accessing the computer and being able to see the network and change settings. There was even a case where a person decided to place links to pornographic websites on the desktop which is just horrible!</p>
<p>There are plenty of commercial solutions for locking down a browser and usually cost a considerable amount per computer. I decided to use freely available open source software to create the locked down kiosk solution that the project called for.</p>
<p>Naturally, I needed to start with a good solid web browser that would allow for the use of plugins and customization. Firefox anyone? I grabbed a copy of Firefox 2 since Firefox 3 isn&#8217;t quite ready for production use yet and went to looking for plugins that would help turn Firefox into a kiosk browser. I stumbled upon <a title="R-Kiosk" href="https://addons.mozilla.org/en-US/firefox/addon/1659" target="_blank">R-kiosk</a> which was exactly what I was looking for! If you read through the comments on the R-kiosk description page you will see that there are a couple shortcomings. The most notable problem is that popup windows are automatically resized to take up the entire screen. Since the menu bar is hidden so that the user can&#8217;t simply hit the &#8220;X&#8221; users can get &#8220;stuck&#8221; on pop up screens! This is a major flaw in the plug in but rather difficult to avoid. Fortunately for my set up, I don&#8217;t have to worry about popup windows. The content that users can view is local to the PC and is not &#8220;live&#8221; internet content. Saman Sadeghi has an <a href="http://samanathon.com/firefox-2s-kiosk-mode/" target="_blank">excellent tutorial about R-kiosk</a> over at his website.</p>
<p>If you read the description for R-Kiosk you will see that it blocks many of the keys in Firefox in order to prevent users from doing certain things. It does work and prevents the user from right clicking and things of that sort. This is great but there are still a number of things that the user could do in order to get back to the computer. R-Kiosk doesn&#8217;t block things like the Windows key or other common key combinations like CTRL-SHIFT-ESC or ALT-SHIFT-ESC that would allow a user to exit the browser window or bring up the Task Manager. I needed to <strong>completely</strong> lock down the computers and only allow the user to do a small set of operations.</p>
<p>In order to do this, I needed a way to control certain key strokes and prevent common ones like the Windows key from working. The best way I found to do this was a simple free program called <a title="AutoHotKey" href="http://www.autohotkey.com/" target="_blank">AutoHotKey</a>. Many gamers use AutoHotKey to create, well, hotkeys, for their games! I personally have used it to create custom hotkeys that make repetitive tasks easier to perform. I created a simple AutoHotKey script that monitors common shortcuts in Firefox and Windows and makes them do nothing which is exactly what is needed when locking down a PC! Here is a copy of the script that I created:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*
Ignore attempts to launch multiple instances of the program
*/</span>
#SingleInstance ignore
#InstallKeybdHook
&nbsp;
<span style="color: #006600; font-style: italic;">/*
Disable a series of keys
*/</span>
&nbsp;
<span style="color: #339933;">!</span>F4<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt F4
<span style="color: #339933;">!</span>Esc<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Escape
Lwin<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Left Windows Key
Rwin<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Right Windows Keyl
<span style="color: #339933;">^</span>Tab<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Tab
<span style="color: #339933;">!</span>Tab<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Tab
<span style="color: #339933;">!+</span>Tab<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Shift Tab
F7<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> F7
<span style="color: #339933;">^+</span>Escape<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Shift Escape
<span style="color: #339933;">!+</span>Escape<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt SHift Escape
<span style="color: #339933;">^</span>A<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl A
<span style="color: #339933;">^</span>R<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl R
<span style="color: #339933;">^</span>P<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl P
<span style="color: #339933;">^</span>X<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl X
<span style="color: #339933;">^</span>C<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl C
<span style="color: #339933;">^</span>V<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl V
<span style="color: #339933;">^</span>T<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl T
<span style="color: #339933;">!</span>VK24<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt <span style="color: #000066;">Home</span>
SC135<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Firefox Quick Find
SC145<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Num Lock
&nbsp;
SC03A<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Caps Lock
SC046<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> <span style="color: #000066;">Scroll</span> Lock
<span style="color: #339933;">!</span>LButton<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Left Click which starts download <span style="color: #000066; font-weight: bold;">in</span> Firefox
<span style="color: #339933;">^</span>LButton<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Left Click which starts download
<span style="color: #339933;">!</span>MButton<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Middle Click which opens a <span style="color: #003366; font-weight: bold;">new</span> tab <span style="color: #000066; font-weight: bold;">in</span> Firefox
<span style="color: #339933;">^</span>MButton<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Middle Click which opens a <span style="color: #003366; font-weight: bold;">new</span> tab
<span style="color: #339933;">+</span>LButton<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Shift Left Click which opens a <span style="color: #003366; font-weight: bold;">new</span> window <span style="color: #000066; font-weight: bold;">in</span> Firefox
<span style="color: #339933;">+</span>MButton<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Shift Middle Click which opens a <span style="color: #003366; font-weight: bold;">new</span> tab
<span style="color: #339933;">+</span>VK0D<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Shift Enter which opens a <span style="color: #003366; font-weight: bold;">new</span> window
<span style="color: #339933;">!+</span>VK0D<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Shift Enter which opens a <span style="color: #003366; font-weight: bold;">new</span> window
<span style="color: #339933;">!</span>VK0D<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Enter which starts download
<span style="color: #339933;">^</span>VK0D<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Enter which opens a <span style="color: #003366; font-weight: bold;">new</span> tab
<span style="color: #339933;">^+</span>VK0D<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Shift Enter opens a <span style="color: #003366; font-weight: bold;">new</span> tab
<span style="color: #339933;">^!</span>VK0D<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Alt Enter opens a <span style="color: #003366; font-weight: bold;">new</span> tab
<span style="color: #339933;">^</span>Escape<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Ctrl Escape
<span style="color: #339933;">!</span>Space<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Space which opens menu bar
<span style="color: #339933;">!+</span>Space<span style="color: #339933;">::</span>  <span style="color: #339933;">;</span> Alt Shift Space which opens menu bar
<span style="color: #000066; font-weight: bold;">return</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*
Set Alt F9 to exit any open Firefox browser
*/</span>
<span style="color: #339933;">!</span>F9<span style="color: #339933;">::</span>
&nbsp;
IfWinExist<span style="color: #339933;">,</span> ahk_class MozillaUIWindowClass <span style="color: #339933;">;</span> Firefox
&nbsp;
<span style="color: #009900;">&#123;</span>
&nbsp;
WinActivate ahk_class MozillaUIWindowClass
&nbsp;
WinClose<span style="color: #339933;">,</span> ahk_class MozillaUIWindowClass
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">return</span></pre></div></div>

<p>As you can see, the top section of code monitors for all sorts of hotkeys and shortcuts. I&#8217;m sure that there are more that I didn&#8217;t come up and I&#8217;d love comments if there are anymore that would be helpful to block! The comments in the code make it rather self explanitory. The first section monitors for keystrokes and that has no action for each keystroke. Looking at the syntax of the AutoHotKey code, notice the &#8220;::&#8221; that comes after each Key sequence. Normally, the action for the hotkey would come after the double colons but my script assigns no action to each key stroke. You will notice that there are a number of characters that are used to represent certain keys in order to detect the keystroke. For example, the &#8220;!&#8221; is used to represent the Alt key. A full list of these character to key associations can be <a href="http://www.autohotkey.com/docs/Hotkeys.htm" target="_blank">found at the AutoHotKey</a> site. There is also excellent <a href="http://www.autohotkey.com/docs/" target="_blank">documentation available</a> that can help your further explore AutoHotKey.</p>
<p>The second half of the code monitors for the Alt-F9 key sequence. This sequence was my testing &#8220;exit key&#8221; used to get me out of Firefox. This will be set to something more complicated, like a series of four keys, so that an administrator could make changes to the machine. If the AutoHotKey detects that Alt-F9 was pressed, it will check to see if any windows exist that belong to the MozillaUIWindowClass. It then closes them which would get an administrator the computer&#8217;s desktop.</p>
<p>Whew! That was a lot of information! I&#8217;m going to take a break now that I have explained a good amount about R-Kiosk and using AutoHotKey to limit key strokes. In the next installment I&#8217;ll talk about my modifications to the Firefox userChrome.css file which allowed me to hide all the features of the Firefox environment except for the back and forward buttons.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidstoker.org/blog/2008/05/27/building-a-kiosk-with-firefox-part-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
