Changes

Programming:Keyboard scanning

2,555 bytes added, 13:09, 8 June 2024
/* See */
== Hardware scancodes ==
Joy1 fire3 and Joy2 fire3 only work on Amstrad CPC, not on Amstrad Plus.
=== English table ===
|'''&45''' || SPACE || N || J || H || Y || U || 7 ' || 8 (
|-
|'''&46''' || V || B (Joy2 fire3) || F (Joy2 fire2) || G (Joy2 fire1) || T (Joy2 right) || R (Joy2 left) || 5 % (Joy2 down)|| 6 & (Joy 2 Joy2 up)
|-
|'''&47''' || X || C || D || S || W || E || 3 # || 4 $
|-
|'''&49''' || DEL || Joy1 fire3 || Joy1 fire2 ||Joy1 fire1||Joy1 right||Joy1 left||Joy1 down||Joy1 up
|}
 
=== Danish table ===
{|{{Prettytable|width: 700px; font-size: 2em;}}
|'''Bit:<br>Line''' || '''7''' || '''6''' || '''5''' || '''4''' || '''3''' || '''2''' || '''1''' || '''0'''
|-
|'''&40''' || F Dot || ENTER || F3 || F6 || F9 || CURDOWN || CURRIGHT || CURUP
|-
|'''&41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPY || CURLEFT
|-
|'''&42''' || CONTROL || ; + || SHIFT || F4 || : * || RETURN || @ \ || CLR
|-
|'''&43''' || . > || / ? || Æ || Ø || P || Å || - = || ^ £
|-
|'''&44''' || , < || M || K || L || I || O || 9 ) || 0 _
|-
|'''&45''' || SPACE || N || J || H || Y || U || 7 ' || 8 (
|-
|'''&46''' || V || B (Joy2 fire3) || F (Joy2 fire2) || G (Joy2 fire1) || T (Joy2 right) || R (Joy2 left) || 5 % (Joy2 down)|| 6 & (Joy2 up)
|-
|'''&47''' || X || C || D || S || W || E || 3 # || 4 $
|-
|'''&48''' || Z || CAPSLOCK || A || TAB || Q || ESC || 2 " || 1 !
|-
|'''&49''' || DEL || Joy1 fire3 || Joy1 fire2 ||Joy1 fire1||Joy1 right||Joy1 left||Joy1 down||Joy1 up
|}
 
=== Spanish table ===
{|{{Prettytable|width: 700px; font-size: 2em;}}
|'''Bit:<br>Line''' || '''7''' || '''6''' || '''5''' || '''4''' || '''3''' || '''2''' || '''1''' || '''0'''
|-
|'''&40''' || F Dot || INTRO || F3 || F6 || F9 || CURDOWN || CURRIGHT || CURUP
|-
|'''&41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPIA || CURLEFT
|-
|'''&42''' || CONTROL || \ ` || MAYS || F4 || ] + || RETURN || [ * || CLR
|-
|'''&43''' || . > || / ? || Ñ || ; : || P || @ ¦ || - = || ^ ₧
|-
|'''&44''' || , < || M || K || L || I || O || 9 ) || 0 _
|-
|'''&45''' || SPACE || N || J || H || Y || U || 7 ' || 8 (
|-
|'''&46''' || V || B (Joy2 fire3) || F (Joy2 fire2) || G (Joy2 fire1) || T (Joy2 right) || R (Joy2 left) || 5 % (Joy2 down)|| 6 & (Joy2 up)
|-
|'''&47''' || X || C || D || S || W || E || 3 # || 4 $
|-
|'''&48''' || Z || FIJA MAYS || A || TAB || Q || ESC || 2 " || 1 !
|-
|'''&49''' || BORR || Joy1 fire3 || Joy1 fire2 ||Joy1 fire1||Joy1 right||Joy1 left||Joy1 down||Joy1 up
|}
|'''&41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPY || CURLEFT
|-
|'''&42''' || CONTROL || $ @\ || SHIFT || F4 || # > || RETURN || * < || CLR
|-
|'''&43''' || . : / || / = + || : M || ; ù % || P || @ ^ ¦ || - ) [ || ^- _
|-
|'''&44''' || , ; . || M , ? || K || L || I || O || ç 9 || à 0
|-
|'''&45''' || SPACE || N || J || H || Y || U || è 7 || ! 8
|-
|'''&46''' || V || B (Joy2 fire3) || F (Joy2 fire2) || G (Joy2 fire1) || T (Joy2 right) || R (Joy2 left) || ( 5 (Joy2 down)|| ] 6 (Joy 2 Joy2 up)
|-
|'''&47''' || X || C || D || S || Z || E || " 3 || ' 4
|'''&49''' || DEL || Joy1 fire3 || Joy1 fire2 ||Joy1 fire1||Joy1 right||Joy1 left||Joy1 down||Joy1 up
|}
 
Note: Fire3 only work on Amstrad CPC, not on Amstrad Plus.
== Computing key code ==
In the CPC world it is more common that a game supports both keyboard and digital joystick for those users who don't own joysticks.
In addition, it is also nice if the keys could be redefined but that is not necessary.
 
The standard CPC can support 3 buttons per joystick, though many CPC joysticks only have 1 button.
 
The CPC+ and GX4000 only support 2 buttons per joystick, and the included Amstrad joypads have 2 buttons.
There are some common keyboard configurations used:
* '''Q,A,O,P,SPACE''' - (Q up, A down, O left, P right, SPACE fire) This is a good solution, and it's a sort of standard (used by many games). It is best for english QWERTY keyboards, on french AZERTY it'd be A-Q-O-P (but because the decoding of the keys is done in software, normally by the OS, the bits in the keyboard matrix are actually the same).
 
The standard CPC has only 1 digital joystick port (and no analog joystick port). But it was possible to daisy chain the official Amstrad joysticks. And a common accessory, the joystick port doubler, offered 2 digital joystick ports.
 
The CPC+ and GX4000 have 2 digital joystick ports built-in (and 1 analog joystick port).
 
== See Also ==
 
* [[Digital Joysticks]]
* [[Keyboard Versions]]
[[Category:Programming]][[Category:CPC Internal Components]]
13,173
edits