<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Generic_Keypad_Class</id>
	<title>Generic Keypad Class - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Generic_Keypad_Class"/>
	<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;action=history"/>
	<updated>2026-08-30T14:05:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;diff=93737&amp;oldid=prev</id>
		<title>Andrew Branscom: /* 5 Constant reference */</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;diff=93737&amp;oldid=prev"/>
		<updated>2025-04-29T01:23:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;5 Constant reference&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:23, 28 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l296&quot;&gt;Line 296:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 296:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;(define KEYPAD_SPECIAL_CANCEL 3)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;(define KEYPAD_SPECIAL_CANCEL 3)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==&amp;lt;br /&amp;gt; References ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;references /&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==&amp;lt;br /&amp;gt; Related Links ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;amp;nbsp;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Keyboard]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Keyboard]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:SCI Keyboard]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Classes]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Classes]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:SCI Classes]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:I/O]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:I/O]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:SCI I/O]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Examples]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Examples]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:SCI Examples]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:SCI Examples]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;diff=88899&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;diff=88899&amp;oldid=prev"/>
		<updated>2025-04-02T22:22:04Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:22, 2 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;diff=88898&amp;oldid=prev</id>
		<title>Andrew Branscom: Andrew Branscom moved page Generic Keypad class to Generic Keypad Class without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Generic_Keypad_Class&amp;diff=88898&amp;oldid=prev"/>
		<updated>2025-04-02T21:30:55Z</updated>

		<summary type="html">&lt;p&gt;Andrew Branscom moved page &lt;a href=&quot;/index.php?title=Generic_Keypad_class&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Generic Keypad class (page does not exist)&quot;&gt;Generic Keypad class&lt;/a&gt; to &lt;a href=&quot;/index.php/Generic_Keypad_Class&quot; title=&quot;Generic Keypad Class&quot;&gt;Generic Keypad Class&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:SCI Pages]]&lt;br /&gt;
[[Category:Temp SCI Import Pages]]&lt;br /&gt;
[[Category:Temp SCI Tutorials]]&lt;br /&gt;
[[SCI Tutorials]]&lt;br /&gt;
[[SCI Tutorials and Guides]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-size: 22pt&amp;quot;&amp;gt;Generic Keypad Class&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;By Lars Skovlund&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==&amp;lt;br /&amp;gt; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Note that I use the ego view for buttons (as I said, I am not a graphic artist). The first the buttons from the left are number buttons, and add the numbers 1, 2 and 3 to the keypad text. The next button cancels, the one after that is backspace, and the last one OK. It would be great if someone would help me make better graphics for the demo code. Instructions are in the documentation. You will also need to add the word &amp;#039;keypad&amp;#039; to your vocabulary.&lt;br /&gt;
&lt;br /&gt;
Code in the attached file, along with documentation.&lt;br /&gt;
&lt;br /&gt;
[http://sierrahelp.com/download.php?file=Files/SCI/GenericKeypadClass.zip Generic Keypad Class Files]&lt;br /&gt;
&lt;br /&gt;
Lars&lt;br /&gt;
&lt;br /&gt;
The Keypad SCI class&amp;lt;br /&amp;gt;&lt;br /&gt;
Lars Skovlund&amp;lt;br /&amp;gt;&lt;br /&gt;
January 17, 2007&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
==1 Introduction==&lt;br /&gt;
&lt;br /&gt;
This is the documentation for the Keypad SCI class, written by Lars Skovlund. I have attempted to make the class as general as possible. Therefore, the class and its descendant DisplayKeypad support arbitrarily long strings of any kind, so it is possible, for instance, to have each button represent a word so the user can construct sentences. The DisplayKeypad class prints the input string somewhere on the screen via the Display kernel call (all parameters are selectable via properties).&lt;br /&gt;
&lt;br /&gt;
The following is a complete feature list for the keypad:&lt;br /&gt;
&lt;br /&gt;
* No keyboard input, for generality reasons.&lt;br /&gt;
* Special button functionality, such as enter, backspace and cancel.&lt;br /&gt;
* Optionally invokes a script when initially showing the keypad and when the enter button is pressed.&lt;br /&gt;
* Optional auto exit mode in which the keypad triggers as soon as the input string reaches its maximum length, as if the user explicitly pressed the enter button.&lt;br /&gt;
* Can require a specific number of buttons to be pressed, or accept any number of button presses.&lt;br /&gt;
* Can play a sound when a button is pressed.&lt;br /&gt;
* Optional text display (DisplayKeypad).&lt;br /&gt;
* A background view can be used or not.&lt;br /&gt;
&lt;br /&gt;
==2 Example of use==&lt;br /&gt;
&lt;br /&gt;
===2.1 Declarations===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(local kptxt[5])&lt;br /&gt;
&lt;br /&gt;
(instance myKeyPad of DisplayKeypad&lt;br /&gt;
	(properties&lt;br /&gt;
		maxLength 	4&lt;br /&gt;
		autoExit 	FALSE&lt;br /&gt;
		script 		0&lt;br /&gt;
		longestText 	1 	/* one character */&lt;br /&gt;
		color 		clBLACK&lt;br /&gt;
		back 		clWHITE&lt;br /&gt;
		x 		20&lt;br /&gt;
		y 		160&lt;br /&gt;
requireMax TRUE&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance key1 of KeypadButton&lt;br /&gt;
	(properties&lt;br /&gt;
		x 	100&lt;br /&gt;
		y 	100&lt;br /&gt;
		view 	0&lt;br /&gt;
		loop 	0&lt;br /&gt;
		text 	&amp;quot;1&amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance key2 of KeypadButton&lt;br /&gt;
	(properties&lt;br /&gt;
		x 	120&lt;br /&gt;
		y 	100&lt;br /&gt;
		view 	0&lt;br /&gt;
		loop 	2&lt;br /&gt;
		text 	&amp;quot;2&amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance key3 of KeypadButton&lt;br /&gt;
	(properties&lt;br /&gt;
		x 	140&lt;br /&gt;
		y 	100&lt;br /&gt;
		view 	0&lt;br /&gt;
		loop 	1&lt;br /&gt;
		text 	&amp;quot;3&amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance key4 of KeypadButton&lt;br /&gt;
	(properties&lt;br /&gt;
		x 	160&lt;br /&gt;
		y 	100&lt;br /&gt;
		view 	0&lt;br /&gt;
		loop 	5&lt;br /&gt;
		special KEYPAD_SPECIAL_CANCEL&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance key5 of KeypadButton&lt;br /&gt;
	(properties&lt;br /&gt;
		x 	180&lt;br /&gt;
		y 	100&lt;br /&gt;
		view 	0&lt;br /&gt;
		loop 	6&lt;br /&gt;
		special KEYPAD_SPECIAL_BKSP&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance key6 of KeypadButton&lt;br /&gt;
	(properties&lt;br /&gt;
		x 	200&lt;br /&gt;
		y 	100&lt;br /&gt;
		view 	0&lt;br /&gt;
		loop 	3&lt;br /&gt;
		special KEYPAD_SPECIAL_ENTER&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===2.2 Handling the enter and cancel buttons===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(instance KeypadScript of Script&lt;br /&gt;
	(properties)&lt;br /&gt;
	(method (changeState newState)&lt;br /&gt;
		(super:changeState(newState))&lt;br /&gt;
		(switch (newState)&lt;br /&gt;
			(case KEYPAD_DONE_STATE&lt;br /&gt;
			  ((send client:hide(FALSE))&lt;br /&gt;
			  FormatPrint(&amp;quot;You typed: %s&amp;quot; @kptxt)))&lt;br /&gt;
(case KEYPAD_ERROR_STATE&lt;br /&gt;
			  (FormatPrint(&amp;quot;You need to press %d buttons.&amp;quot;&lt;br /&gt;
				(send client:maxLength()))))&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===2.3 Initialization and activation===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;(myKeyPad:setScript(KeypadScript) outputString(@kptxt)&lt;br /&gt;
  init(key1 key2 key3 key4 key5 key6))&lt;br /&gt;
&lt;br /&gt;
(myKeyPad:init() show()) /* The init ensures that the keypad can&lt;br /&gt;
			    be used any number of times. */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==3 What to draw==&lt;br /&gt;
&lt;br /&gt;
You will need a view consisting of several loops, one for each button. Each loop should contain two cels: The button in its normal and depressed state, respectively. It is important that the cels are ordered in this way; the code depends on it, and you should not set the cel property to anything when declaring KeypadButtons.&lt;br /&gt;
&lt;br /&gt;
If you want a background view you can draw this as a separate loop. Declare it in your code as an instance of the Prop class. Then refer to it in your Keypad instance using the backView property.&lt;br /&gt;
&lt;br /&gt;
==4 Class reference==&lt;br /&gt;
&lt;br /&gt;
===4.1 Keypad class===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Superclass: 			  EventHandler&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This class provides the base functionality for keypads.&lt;br /&gt;
&lt;br /&gt;
====&amp;#039;&amp;#039;Methods of the Keypad class:&amp;#039;&amp;#039;====&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad init: buttons . . . )&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This function initializes the object, as is the case with every SCI class. In particular, it resets the input string and notifies the controlling script. Buttons is a list of button views (instances of KeypadButton) to include in the keypad.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad show:)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Displays the keypad. The player is prevented from moving until the keypad is dismissed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad hide: doCue)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Hides the keypad. DoCue should be set to TRUE if the “enter” button was pressed, FALSE otherwise. When the script is called, the buttons have not yet been removed from the screen. If you want this, your script must explicitly call hide with a FALSE parameter (to avoid infinite recursion)—this is what the example code does, see section 2.2.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad backspace:)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Self-explanatory. You will need to override this if you use text of varying lengths for the buttons.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad draw:)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad setSize:)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Do nothing. They are only here to prevent the game from crashing in certain situations (in particular, restoring the game to a position where the keypad is displayed).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad depress: which)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Simulates the pressing of a button. Which refers to an actual instance of KeypadButton.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Keypad setScript: newScript params)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Sets the controlling script of the keypad. This script is called once when the keypad is initially displayed and once when the user presses “enter”. It is not called if the user cancels the dialog.&lt;br /&gt;
&lt;br /&gt;
====&amp;#039;&amp;#039;Properties of the Keypad class:&amp;#039;&amp;#039;====&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;outputString&amp;#039;&amp;#039;&amp;#039; Points to the output buffer. Remember to set this at run time, and remember that it must be big enough for anything the player might press. Use a local variable, as shown in section 2.1.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;maxLength&amp;#039;&amp;#039;&amp;#039; Indicates the length of the output buffer.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;autoExit&amp;#039;&amp;#039;&amp;#039; Boolean variable which toggles the “auto exit” mode, described in the introduction.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;backView&amp;#039;&amp;#039;&amp;#039; Points to an instance of Prop which is displayed when the keypad is activated. It is meant to be used for a background, hence the name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;backPri&amp;#039;&amp;#039;&amp;#039; Indicates the priority of the background. May be omitted; the priority of the buttons is always 1 greater than this value, if specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;btnSound&amp;#039;&amp;#039;&amp;#039; Points to an instance of Sound which is played whenever the user presses a button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;longestText&amp;#039;&amp;#039;&amp;#039; Indicates the length of the longest button text.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;script&amp;#039;&amp;#039;&amp;#039; Indicates the controlling script. Use setScript to set this, never set it directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;state&amp;#039;&amp;#039;&amp;#039; Boolean variable. Indicates whether the keypad is currently shown or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;special&amp;#039;&amp;#039;&amp;#039; Not used for anything. Works around a chicken-and-egg problem regarding selector names in SCI Studio.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;requireMax&amp;#039;&amp;#039;&amp;#039; Setting this to true makes the keypad require maxLength characters to be filled in. If this requirement is not met when the player presses enter, the attached script executes its keypad error state. You can do whatever you want here, including doing nothing, displaying an error message, or blowing up the universe. The keypad remains functional after the script returns.&lt;br /&gt;
&lt;br /&gt;
;Notes&lt;br /&gt;
&lt;br /&gt;
For the predefined script, three states are predefined. Constants are provided&lt;br /&gt;
in the enclosed header file.&lt;br /&gt;
&lt;br /&gt;
===4.2 KeypadButton class===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Superclass: 			  Prop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This class provides the button views to be used for the keypad; they provide an event handler and a special feed-back interface for the &amp;lt;u&amp;gt;Keypad&amp;lt;/u&amp;gt; class. None of the overridden methods are meant to be called directly.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Methods of the KeypadButton class:&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(KeypadButton init: theClient priority)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(KeypadButton handleEvent: event)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Properties of the KeypadButton class:&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;text&amp;#039;&amp;#039;&amp;#039; The text to add when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;special&amp;#039;&amp;#039;&amp;#039; The special meaning that this button is to have.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;client&amp;#039;&amp;#039;&amp;#039; A pointer to the keypad which “owns” this button. Filled in automatically.&lt;br /&gt;
&lt;br /&gt;
;Notes&lt;br /&gt;
&lt;br /&gt;
Three special button types are provided beside the default, namely enter, backspace and cancel.&lt;br /&gt;
&lt;br /&gt;
===4.3 DisplayKeypad class===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Superclass: 			  Keypad&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This class provides the additional functionality of displaying the current text string at a predetermined position on the screen. All of the listed properties have the same format as those passed to the Display kernel function.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Properties of the DisplayKeypad class:&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;underBits&amp;#039;&amp;#039;&amp;#039; stores a handle to the screen area under the text string.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;y&amp;#039;&amp;#039;&amp;#039; Coordinates where the text string is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;font&amp;#039;&amp;#039;&amp;#039; The font to use.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;color&amp;#039;&amp;#039;&amp;#039; The foreground color.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;back&amp;#039;&amp;#039;&amp;#039; The background color.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;width&amp;#039;&amp;#039;&amp;#039; The width to use for wrapping the text, if that should ever be necessary.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;align&amp;#039;&amp;#039;&amp;#039; The alignment to use.&lt;br /&gt;
&lt;br /&gt;
==5 Constant reference==&lt;br /&gt;
&lt;br /&gt;
(define KEYPAD_INIT_STATE 0)&amp;lt;br /&amp;gt;&lt;br /&gt;
(define KEYPAD_DONE_STATE 1)&amp;lt;br /&amp;gt;&lt;br /&gt;
(define KEYPAD_ERROR_STATE 2)&lt;br /&gt;
&lt;br /&gt;
(define KEYPAD_SPECIAL_NONE 0)&amp;lt;br /&amp;gt;&lt;br /&gt;
(define KEYPAD_SPECIAL_ENTER 1)&amp;lt;br /&amp;gt;&lt;br /&gt;
(define KEYPAD_SPECIAL_BKSP 2)&amp;lt;br /&amp;gt;&lt;br /&gt;
(define KEYPAD_SPECIAL_CANCEL 3)&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
[[Category:Keyboard]]&lt;br /&gt;
[[Category:Classes]]&lt;br /&gt;
[[Category:I/O]]&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:SCI Examples]]&lt;/div&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
</feed>