* Update the status of the Family KeyBoard. */
| 1870 | * Update the status of the Family KeyBoard. |
| 1871 | */ |
| 1872 | static void UpdateFKB(void) |
| 1873 | { |
| 1874 | int x; |
| 1875 | char leftShiftDown, vkeyDown; |
| 1876 | //static char lp[0x48]; |
| 1877 | |
| 1878 | vkeyDown = getFamilyKeyboardVirtualKey(50); |
| 1879 | |
| 1880 | leftShiftDown = DTestButton(&fkbmap[50], true) || vkeyDown; |
| 1881 | |
| 1882 | for (x = 0; x < FAMILYKEYBOARD_NUM_BUTTONS; x++) |
| 1883 | { |
| 1884 | if ( leftShiftDown && (x == 62) ) |
| 1885 | { // Family BASIC appears to not like when both shift keys are pressed at the |
| 1886 | // same time. Since Qt key events do not differentiate between left and right |
| 1887 | // shift this GUI sets both left and right shift scancodes when a shift modifier |
| 1888 | // is detected. So to avoid having the FKB see both shift keys pressed at once, |
| 1889 | // always skip the right shift key here if the left key is already detected down. |
| 1890 | fkbkeys[x] = 0; |
| 1891 | continue; |
| 1892 | } |
| 1893 | |
| 1894 | vkeyDown = getFamilyKeyboardVirtualKey(x); |
| 1895 | |
| 1896 | if (DTestButton(&fkbmap[x], true) || vkeyDown) |
| 1897 | { |
| 1898 | fkbkeys[x] = 1; |
| 1899 | |
| 1900 | //if ( !lp[x] ) |
| 1901 | //{ |
| 1902 | // printf("FKB Key %i Down\n", x ); |
| 1903 | //} |
| 1904 | } |
| 1905 | else |
| 1906 | { |
| 1907 | fkbkeys[x] = 0; |
| 1908 | |
| 1909 | //if ( lp[x] ) |
| 1910 | //{ |
| 1911 | // printf("FKB Key %i Up\n", x ); |
| 1912 | //} |
| 1913 | } |
| 1914 | //lp[x] = fkbkeys[x]; |
| 1915 | } |
| 1916 | } |
| 1917 | |
| 1918 | const uint8_t *getFamilyKeyboardState(void) |
| 1919 | { |
no test coverage detected