mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-28 03:39:35 +03:00
Shell: CapsLock and Shift keys
git-svn-id: svn://kolibrios.org@2174 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
9f2f10d775
commit
de6e26f7d9
@ -10,6 +10,7 @@
|
||||
#include "system/kolibri.h"
|
||||
#include "system/stdlib.h"
|
||||
#include "system/string.h"
|
||||
#include "system/ctype.h"
|
||||
|
||||
#include "globals.h"
|
||||
#include "prototypes.h"
|
||||
|
@ -6,7 +6,8 @@ gcc -c shell.c
|
||||
gcc -c system/kolibri.c
|
||||
gcc -c system/stdlib.c
|
||||
gcc -c system/string.c
|
||||
ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o shell.o
|
||||
gcc -c system/ctype.c
|
||||
ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o ctype.o shell.o
|
||||
objcopy shell -O binary
|
||||
erase lang.h start.o shell.o kolibri.o stdlib.o string.o
|
||||
kpack shell
|
||||
|
@ -6,7 +6,8 @@ gcc -c shell.c
|
||||
gcc -c system/kolibri.c
|
||||
gcc -c system/stdlib.c
|
||||
gcc -c system/string.c
|
||||
ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o shell.o
|
||||
gcc -c system/ctype.c
|
||||
ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o ctype.o shell.o
|
||||
objcopy shell -O binary
|
||||
erase lang.h start.o shell.o kolibri.o stdlib.o string.o
|
||||
kpack shell
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
#define SHELL_VERSION "0.4.8"
|
||||
#define SHELL_VERSION "0.4.9"
|
||||
|
||||
extern char PATH[256];
|
||||
extern char PARAM[256];
|
||||
|
@ -74,6 +74,13 @@ for (;;)
|
||||
default:
|
||||
if (CMD_POS < 255)
|
||||
{
|
||||
|
||||
if ( kol_key_control() & 0x40 ) // åñëè âêëþ÷¸í CapsLock
|
||||
if ( (kol_key_control() & 1) || (kol_key_control() & 2)) // åñëè íàæàòû øèôòû
|
||||
key = tolower(key);
|
||||
else
|
||||
key = toupper(key);
|
||||
|
||||
CMD[CMD_POS] = key;
|
||||
CMD_POS++;
|
||||
printf("%c", key);
|
||||
|
39
programs/system/shell/system/ctype.c
Normal file
39
programs/system/shell/system/ctype.c
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
#include "ctype.h"
|
||||
|
||||
int toupper(int c)
|
||||
{
|
||||
|
||||
if ( (c >= 97) && (c <= 122) )
|
||||
return c-32 ;
|
||||
|
||||
if ( (c >= 160) && (c <= 175) )
|
||||
return c-32 ;
|
||||
|
||||
if ( (c >= 224) && (c <= 239) )
|
||||
return c-80 ;
|
||||
|
||||
if ( (c == 241) || (c == 243) || (c == 245) || (c == 247) )
|
||||
return c-1;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
int tolower(int c)
|
||||
{
|
||||
|
||||
if ( (c >= 65) && (c <= 90) )
|
||||
return c+32 ;
|
||||
|
||||
if ( (c >= 128) && (c <= 143) )
|
||||
return c+32 ;
|
||||
|
||||
if ( (c >= 144) && (c <= 159) )
|
||||
return c+80 ;
|
||||
|
||||
if ( (c == 240) || (c == 242) || (c == 244) || (c == 246) )
|
||||
return c+1;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
3
programs/system/shell/system/ctype.h
Normal file
3
programs/system/shell/system/ctype.h
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
int toupper(int c);
|
||||
int tolower(int c);
|
Loading…
Reference in New Issue
Block a user