mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-29 13:03:36 +01:00
keyboard stdio: some fixes
This commit is contained in:
parent
1685813078
commit
c80debacd7
5 changed files with 11 additions and 6 deletions
3
TODO
3
TODO
|
@ -11,7 +11,8 @@ Tests to run.
|
||||||
* bopti: more sizes, gray
|
* bopti: more sizes, gray
|
||||||
* topti: all charsets, colors
|
* 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: use topti in the error message for missing mappings
|
||||||
* core: find the #ifdef FX9860G|FXCG50 that have a cross-platform def
|
* core: find the #ifdef FX9860G|FXCG50 that have a cross-platform def
|
||||||
* topti: support Unicode fonts
|
* topti: support Unicode fonts
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
/* Delay between a key press and the first repeat, in scan intervals */
|
/* Delay between a key press and the first repeat, in scan intervals */
|
||||||
static int rep_first = 64;
|
static int rep_first = 64;
|
||||||
/* Delay between subsequent repeats, in scan intervals */
|
/* Delay between subsequent repeats, in scan intervals */
|
||||||
static int rep_next = 16;
|
static int rep_next = 8;
|
||||||
|
|
||||||
/* getkey() - wait for a pressed key */
|
/* getkey() - wait for a pressed key */
|
||||||
key_event_t getkey(void)
|
key_event_t getkey(void)
|
||||||
|
@ -95,7 +95,11 @@ key_event_t getkey_opt(int opt, volatile int *timeout)
|
||||||
arrow)) break;
|
arrow)) break;
|
||||||
|
|
||||||
/* If the key is key pressed long enough, create a new event */
|
/* 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.mod = 1;
|
||||||
ev.shift = shift;
|
ev.shift = shift;
|
||||||
|
|
|
@ -184,7 +184,7 @@ static void init(void)
|
||||||
if(!delay) delay = 1;
|
if(!delay) delay = 1;
|
||||||
|
|
||||||
/* Set the default repeat times (milliseconds) */
|
/* Set the default repeat times (milliseconds) */
|
||||||
getkey_repeat(500, 125);
|
getkey_repeat(400, 40);
|
||||||
|
|
||||||
timer_setup(tid, delay, 0, callback, NULL);
|
timer_setup(tid, delay, 0, callback, NULL);
|
||||||
timer_start(tid);
|
timer_start(tid);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <gint/display.h>
|
#include <gint/display.h>
|
||||||
#include <display/common.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 CHAR_SPACING 1
|
||||||
#define PROP_SPACING 5
|
#define PROP_SPACING 5
|
||||||
|
|
||||||
|
|
|
@ -547,7 +547,7 @@ static void kformat_fixed(KFORMAT_ARGS)
|
||||||
|
|
||||||
for(int i = g.content - 2; i >= 0; i--)
|
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]);
|
kprint_out(digits[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue