os-series icon indicating copy to clipboard operation
os-series copied to clipboard

Im trying to make input.

Open Toni-d-e-v opened this issue 3 years ago • 8 comments

Is there any way I can include stdio.h or something just to get scanf func, or how to make it and include it like in print.h thanks in advance

Toni-d-e-v avatar Mar 04 '21 11:03 Toni-d-e-v

probably not, i tried

fortmea avatar Mar 05 '21 23:03 fortmea

Adding input requires that you add:

and various other items before you can even begin to add keyboard support. I'm sure we'll get there eventually, but it'll take at least an episode or two more before we are there (if we keep up the current pace, that is).

zevaryx avatar Mar 06 '21 23:03 zevaryx

take a look at this

Roseinabox28 avatar May 05 '21 04:05 Roseinabox28

I went and started implementing this

Roseinabox28 avatar May 05 '21 05:05 Roseinabox28

thx

Toni-d-e-v avatar May 07 '21 12:05 Toni-d-e-v

Issue #14 is also helpfull

Kjur0 avatar Jun 10 '21 19:06 Kjur0

I went and started implementing this

This seems a very good start, but it has several problems that should be fixed:

  1. There is an unneeded delay between pressing different keys and there is too short delay between autorepeating the same key that is pressed for a long time. Probably, as a start, "no autorepeating at all" seems a good strategy, because actually autorepeating is usually needed only for long cursor movement and long backspaces.
  2. Delay currently depends on CPU speed. Using timer will be better. Do you have ideas how to implement this?
  3. Depressing Left Shift still continues to input upper case letters.
  4. Caps lock is not processed correctly - instead it is processed as some unknown key.
  5. Pressing Right Shift hangs the whole program.
  6. Pressing Backspace results in strange behavior when near left edge of the screen.

rualark avatar Jul 30 '21 00:07 rualark

I went and started implementing this

Thank you so much for your inspiration! It is interesting that input can be implemented without interrupts. I tried to improve input code:

  • Removed delay between different characters, added longer delay before first symbol autorepeat
  • Fixed shift keys
  • Return string that was input
  • Return if Enter or Esc was pressed
  • Added cursor movement
  • Added color spin to demonstrate how to do multiple tasks without threads

I also implemented precise nanosleep and added beep.

https://github.com/rualark/SimpleOsDemo

rualark avatar Aug 01 '21 04:08 rualark