<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ocr.michiyo.me/w/index.php?action=history&amp;feed=atom&amp;title=API%2Fkeyboard</id>
	<title>API/keyboard - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ocr.michiyo.me/w/index.php?action=history&amp;feed=atom&amp;title=API%2Fkeyboard"/>
	<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=API/keyboard&amp;action=history"/>
	<updated>2026-08-24T13:46:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://ocr.michiyo.me/w/index.php?title=API/keyboard&amp;diff=1034&amp;oldid=prev</id>
		<title>imported&gt;OCDoc Import: Imported from legacy OpenComputers documentation at ocdoc.cil.li</title>
		<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=API/keyboard&amp;diff=1034&amp;oldid=prev"/>
		<updated>2026-08-24T08:08:27Z</updated>

		<summary type="html">&lt;p&gt;Imported from legacy OpenComputers documentation at ocdoc.cil.li&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Keyboard API =&lt;br /&gt;
&lt;br /&gt;
This API allows you to refer to key codes by name, using the `keyboard.keys` table. This is a two-directional table, for example, the value of `keyboard.keys.numpad0` is `0x52`, and the value of `keyboard.keys[0x52]` is the string `numpad0`.&lt;br /&gt;
&lt;br /&gt;
Please see [the Lua file containing the API&amp;#039;s implementation](https://github.com/MightyPirates/OpenComputers/blob/master-MC1.7.10/src/main/resources/assets/opencomputers/loot/openos/lib/keyboard.lua) for the list of available names.&lt;br /&gt;
&lt;br /&gt;
Additionally it registers event listeners to keep track of the state of individual keys. This internal state can be queried using the following functions:&lt;br /&gt;
&lt;br /&gt;
* `keyboard.isAltDown(): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Checks if one of the Alt keys is currently being held by some user.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `keyboard.isControl(char: number): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Checks if the specified character (from a keyboard event for example) is a control character as defined by Java&amp;#039;s `Character` class. Control characters are usually not printable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `keyboard.isControlDown(): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Checks if one of the Control keys is currently being held by some user.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `keyboard.isKeyDown(charOrCode: any): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Checks if a specific key is currently being by some user. If a number is specified it is assumed it&amp;#039;s a key code. If a string is specified it is assumed it&amp;#039;s a single character, such as the ones passed by keyboard events.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `keyboard.isShiftDown(): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Checks if one of the Shift keys is currently being held by some user.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[keyboard]: https://github.com/MightyPirates/OpenComputers/assets/opencomputers/lua/rom/lib/keyboard.lua&lt;br /&gt;
&lt;br /&gt;
== Contents ==&lt;br /&gt;
&lt;br /&gt;
{{:API/contents}}&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;OCDoc Import</name></author>
	</entry>
</feed>