/* * SuperInput demo - A new way to type text on casio fx calculators ! * Copyright (C) 2022 Mibi88 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see https://www.gnu.org/licenses/. */ #include #include #define INSZ 20 #define INSZS1 (INSZ-1) unsigned char input[INSZ], keyc; int pos, lenght, shift, alpha, inchar, key; void shiftstrpartright(int start){ unsigned char c; unsigned char copy[INSZ]; for(int i=0;i 0){ pos--; }else if(key == KEY_RIGHT && pos < lenght){ pos++; } if(key == KEY_SHIFT){ shift = !shift; }else if(key == KEY_ALPHA){ alpha = !alpha; }else if(key == KEY_DEL && pos > 0){ shiftstrpartleft(pos-1); lenght--; pos--; } dclear(C_WHITE); dtext(1, 1, C_BLACK, (char*)input); dline(pos*6, 1, pos*6, 7, C_BLACK); dupdate(); clearevents(); } return 1; }