Keyboard input

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
glauxosdev
Member
Member
Posts: 119
Joined: Tue Jan 20, 2015 9:01 am
Libera.chat IRC: glauxosdever

Re: Keyboard input

Post by glauxosdev »

I think it's a good idea, thank you.
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: Keyboard input

Post by Roman »

char key
terminal_writestring(key)
If you are following the Bare Bones tutorial, this code will crash. You don't look like someone who understands even C.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
Icee
Member
Member
Posts: 100
Joined: Wed Jan 08, 2014 8:41 am
Location: Moscow, Russia

Re: Keyboard input

Post by Icee »

catnikita255 wrote:There's a code:

Code: Select all

char oldkey;
char key;
for(;;)
{
   oldkey = key;
   key = inb(60);
   if(!oldkey = key)
   terminal_writestring(key);
}
This wouldn't even compile because "!oldkey" is not an l-value.
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: Keyboard input

Post by osdever »

Thank you for that, now keyboard is working.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Post Reply