MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / GetKeycode

Method GetKeycode

source/Pravets.cpp:60–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58//Writing into $C060 sets MODE on and off. If bit 0 is 0 the the MODE is set 0, if bit 0 is 1 then MODE is set to 1 (8-bit)
59
60BYTE Pravets::GetKeycode(BYTE floatingBus) // Read $C060
61{
62 const BYTE uCurrentKeystroke = KeybGetKeycode();
63 BYTE C060 = floatingBus;
64
65 if (GetApple2Type() == A2TYPE_PRAVETS8A && g_CapsLockAllowed) //8bit keyboard mode
66 {
67 if ((!P8CAPS_ON && !P8Shift) || (P8CAPS_ON && P8Shift)) //LowerCase
68 {
69 if ((uCurrentKeystroke<65) //|| ((uCurrentKeystroke>90) && (uCurrentKeystroke<96))
70 || ((uCurrentKeystroke>126) && (uCurrentKeystroke<193)))
71 C060 |= 1 << 7; //Sets bit 7 to 1 for special keys (arrows, return, etc) and for control+ key combinations.
72 else
73 C060 &= 0x7F; //sets bit 7 to 0
74 }
75 else //UpperCase
76 {
77 C060 |= 1 << 7;
78 }
79 }
80 else //7bit keyboard mode
81 {
82 C060 &= 0xBF; //Sets bit 6 to 0; I am not sure if this shall be done, because its value is disregarded in this case.
83 C060 |= 1 << 7; //Sets bit 7 to 1
84 }
85
86 return C060;
87}
88
89BYTE Pravets::SetCapsLockAllowed(BYTE value) // Write $C060
90{

Callers 1

TapeReadFunction · 0.80

Calls 2

KeybGetKeycodeFunction · 0.85
GetApple2TypeFunction · 0.85

Tested by

no test coverage detected