Browse Source

keyboard stdio: some fixes

compat
lephe 4 months ago
parent
commit
c80debacd7
5 changed files with 11 additions and 6 deletions
  1. 2
    1
      TODO
  2. 6
    2
      src/keysc/getkey.c
  3. 1
    1
      src/keysc/keysc.c
  4. 1
    1
      src/render/topti.c
  5. 1
    1
      src/std/stdio.c

+ 2
- 1
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

+ 6
- 2
src/keysc/getkey.c 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;

+ 1
- 1
src/keysc/keysc.c 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);

+ 1
- 1
src/render/topti.c 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


+ 1
- 1
src/std/stdio.c 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]);
}


Loading…
Cancel
Save