keyspyxp - polskie znaki i duże litery

0
begin
                if ((stan_old[16]<-32760)or(stan_old[20]<-32760))and(i>=65)and(i<=90) then
                key:=ansiuppercase(key);

                  if (stan_old[165]<-32760) then
                begin
                 if Odd(integer(i=65)) then key:='ą';
                 if Odd(integer(i=67)) then key:='ć';
                 if Odd(integer(i=69)) then key:='ę';
                 if Odd(integer(i=76)) then key:='ł';
                 if Odd(integer(i=78)) then key:='ń';
                 if Odd(integer(i=79)) then key:='ó';
                 if Odd(integer(i=83)) then key:='ś';
                 if Odd(integer(i=88)) then key:='ź';
                 if Odd(integer(i=90)) then key:='ż';
                 if ((stan_old[16]<-32760)or(stan_old[20]<-32760))and(i>=65)and(i<=90) then
                 begin
                 if Odd(integer(i=65)) then key:='Ą';
                 if Odd(integer(i=67)) then key:='Ć';
                 if Odd(integer(i=69)) then key:='Ę';
                 if Odd(integer(i=76)) then key:='Ł';
                 if Odd(integer(i=78)) then key:='Ń';
                 if Odd(integer(i=79)) then key:='Ó';
                 if Odd(integer(i=83)) then key:='Ś';
                 if Odd(integer(i=88)) then key:='Ź';
                 if Odd(integer(i=90)) then key:='Ż';
                end;
                end;

Zmieniłem trochę kod, żeby po wciśnięciu shifta były duże litery, po wciśnięciu ALR GR- polskie znaki, no i po wciśnięciu shift+alt+znak= duży polski znak.
Wszystko działa poprawnie, tylko da się skrócić jakoś ten kod?

0

chyba nie

0

Jaki Ci przeszkadza to napisz wszystko w jednej linii, albo ewentualnie napisz warunek "case":

case jakaś_zmienna of
wartość_np_liczba :          funkcja_wykonywana_jeśli_zmienna_ma_taką_wartość ;
inna_wartość_też_liczba :        funkcja_wykonywana_jeśli_zmienna_ma_taką_wartość ;
kolejna_wartość_koniecznie_liczba :    funkcja_wykonywana_jeśli_zmienna_ma_taką_wartość ;
else         funkcja_wykonywana_jeśli_zmienna_ma_inną_wartość_od_podanych_wyżej;
end;

1 użytkowników online, w tym zalogowanych: 0, gości: 1