keyboard stdio: some fixes

This commit is contained in:
lephe 2019-07-17 19:29:12 -04:00
parent 1685813078
commit c80debacd7
5 changed files with 11 additions and 6 deletions

3
TODO
View file

@ -11,7 +11,8 @@ Tests to run.
* bopti: more sizes, gray
* topti: all charsets, colors
Completeness elements on existing code.
Complementary elements on existing code.
* dma: dma_memcpy() and dma_memset(), possibly requiring alignment
* core: use topti in the error message for missing mappings
* core: find the #ifdef FX9860G|FXCG50 that have a cross-platform def
* topti: support Unicode fonts

View file

@ -12,7 +12,7 @@
/* Delay between a key press and the first repeat, in scan intervals */
static int rep_first = 64;
/* Delay between subsequent repeats, in scan intervals */
static int rep_next = 16;
static int rep_next = 8;
/* getkey() - wait for a pressed key */
key_event_t getkey(void)
@ -95,7 +95,11 @@ key_event_t getkey_opt(int opt, volatile int *timeout)
arrow)) break;
/* If the key is key pressed long enough, create a new event */
if(++rep_time < (rep_count ? rep_next : rep_first)) break;
int target = (rep_count) ? rep_next : rep_first;
if(++rep_time < target) break;
rep_time -= target;
rep_count++;
ev.mod = 1;
ev.shift = shift;

View file

@ -184,7 +184,7 @@ static void init(void)
if(!delay) delay = 1;
/* Set the default repeat times (milliseconds) */
getkey_repeat(500, 125);
getkey_repeat(400, 40);
timer_setup(tid, delay, 0, callback, NULL);
timer_start(tid);

View file

@ -2,7 +2,7 @@
#include <gint/display.h>
#include <display/common.h>
/* These parameters will eventually be specified by the font */
/* TODO: These parameters will eventually be specified by the font */
#define CHAR_SPACING 1
#define PROP_SPACING 5

View file

@ -547,7 +547,7 @@ static void kformat_fixed(KFORMAT_ARGS)
for(int i = g.content - 2; i >= 0; i--)
{
if(i == opt->precision) kprint_out('.');
if(i == opt->precision - 1) kprint_out('.');
kprint_out(digits[i]);
}