SndDoCmd(NULL, &snd, false);
}
*/
+static int deviceTreo6x0 = 0;
uint32_t CheckDeviceTreo_stub(uint32_t *);
-uint32_t CheckDeviceTreo_stub(uint32_t *param)
-{
- uint32_t companyID = 0;
- uint32_t deviceID = 0;
- FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID);
- FtrGet(sysFtrCreator, sysFtrNumOEMDeviceID, &deviceID);
-
- if (((companyID == 'hspr') &&
- (deviceID == 'H101' || deviceID == 'H102')) ||
- (companyID == 'Palm' && deviceID == 'D052'))
- {
- return 1;
- }
- return 0;
+uint32_t CheckDeviceTreo_stub(uint32_t *param) {
+ uint32_t companyID = 0;
+ uint32_t deviceID = 0;
+ FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID);
+ FtrGet(sysFtrCreator, sysFtrNumOEMDeviceID, &deviceID);
+
+ if (((companyID == 'hspr') &&
+ (deviceID == 'H101' /* Tro 600 */
+ || deviceID == 'H102' /* Treo 650 */
+ )) ||
+ (companyID == 'Palm' &&
+ (deviceID == 'D052' /* Treo 700p*/
+ || deviceID == 'D053' /* Treo 680 */
+ || deviceID == 'D060' /* Treo 755p */
+ || deviceID == 'D061' /* Centro 685 */
+ || deviceID == 'D062' /* Centro 690 */
+ ))) {
+ deviceTreo6x0 = 1;
+ }
+ return deviceTreo6x0;
+}
+
+/* Alternate keymap for alt key */
+
+static unsigned char altsym_symbol_map[32] = {
+ /* SP */ ' ', /* ! */ '|', /* " */ '~', /* # */ '{',
+ /* $ */ '%', /* % */ '%', /* & */ '&', /* ' */ '`',
+ /* ( */ '[', /* ) */ ']', /* * */ '^', /* + */ '=',
+ /* , */ '<', /* - */ '_', /* . */ '>', /* / */ '\\',
+ /* 0 */ ')', /* 1 */ '!', /* 2 */ '@', /* 3 */ '#',
+ /* 4 */ '$', /* 5 */ '%', /* 6 */ '^', /* 7 */ '&',
+ /* 8 */ '*', /* 9 */ '(', /* : */ ';', /* ; */ ':',
+ /* < */ ',', /* = */ '+', /* > */ '.', /* ? */ '}'
+};
+
+static unsigned char altsym_treo_map[26] = {
+ /* A */ '&', /* B */ '{', /* C */ '*', /* D */ '$', /* E */ '!',
+ /* F */ '%', /* G */ '^', /* H */ '%', /* I */ '&', /* J */ '|',
+ /* K */ ';', /* L */ '`', /* M */ '<', /* N */ '}', /* O */ '~',
+ /* P */ '%', /* Q */ '\\', /* R */ '@', /* S */ '_', /* T */ '#',
+ /* U */ ']', /* V */ '(', /* W */ '=', /* X */ '&', /* Y */ '[',
+ /* Z */ '^'
+};
+
+static unsigned char altsym_tungsten_map[26] = {
+ /* A */ ';', /* B */ '|', /* C */ ']', /* D */ '=', /* E */ '#',
+ /* F */ '_', /* G */ '^', /* H */ '-', /* I */ '*', /* J */ '~',
+ /* K */ '`', /* L */ '&', /* M */ '}', /* N */ '<', /* O */ '(',
+ /* P */ ')', /* Q */ '!', /* R */ '$', /* S */ '\\', /* T */ '%',
+ /* U */ '&', /* V */ '{', /* W */ '@', /* X */ '[', /* Y */ '^',
+ /* Z */ '%'
+
+};
+
+uint32_t altsym_character_stub(unsigned char *);
+uint32_t altsym_character_stub(unsigned char *c) {
+ if (*c == '@') return '&';
+ if (*c == '_') return '-';
+ if (*c >= 0x20 && *c < 0x40) return (uint32_t) altsym_symbol_map[*c - 0x20];
+ if (deviceTreo6x0) {
+ if (*c >= 'A' && *c <= 'Z') return (uint32_t) altsym_treo_map[*c - 'A'];
+ if (*c >= 'a' && *c <= 'z') return (uint32_t) altsym_treo_map[*c - 'a'];
+ } else {
+ // for now, use tungsten layout on all but treo
+ // note there is currently no way to get altPressed on the tungsten
+ if (*c >= 'A' && *c <= 'Z') return (uint32_t) altsym_tungsten_map[*c - 'A'];
+ if (*c >= 'a' && *c <= 'z') return (uint32_t) altsym_tungsten_map[*c - 'a'];
+ }
+ return (uint32_t) *c;
+}
+
+uint32_t control_character_stub(unsigned char *);
+uint32_t control_character_stub(unsigned char *c) {
+ if (*c == ' ' || *c == '@') return '\0'; // C-space, C-@
+ if (*c >= 'a' && *c <= 'z') return *c - 'a' + 1; // C-a .. C-z
+ if (*c >= 'A' && *c <= 'Z') return *c - 'A' + 1; // C-A .. C-Z
+ if (*c >= '[' && *c <= '_') return *c - 'A' + 1; // C-[ .. C-_
+ if (*c >= '{' && *c <= '}') return *c - 'a' + 1; // C-{ .. C-} (no C-~)
+ return c;
}