Z wyświetlaniem dużych, małych i w dodatku polskich literek sobie poradziłem.
Ale nie wyświetlają mi się żadne znaki numeryczne , ani znaki specjalne - jak klamry, przecinek itd...
Podaje przykładowy kod w oparciu o powyższe tu podane kodziki.
Jest to tylko zrobione dla Edita w celu przetestowania.
Proszę zerknijcie - może da radę to jakoś uprościć odpowiednią instrukcją, oraz
może któryś z Was wie jak wyświetlić te znaki o które mi chodzi.
//tu dla przykładu klikając na ten edit zostaje wpisany tekst
procedure TForm1.Edit1Click(Sender: TObject);
var
tekst :String;
sst :TShiftState;
key :Char;
x :Integer;
opcja :Byte;
Begin
Edit1.Text:= '';
//wypisuje zdania literka po literce...
tekst:= 'To SĄ polskie Litery ą ć ę ł ń ó ś ż ź oraz znaki / < ? ;, {]';
for x:= 1 to Length(tekst) do
begin
key:= #0; opcja:= 0; sst:= [];
//ustawia opcje dla polskiej litery...
if (tekst[x] = 'ą') then begin key:= #65; opcja:= 1; end;
if (tekst[x] = 'Ą') then begin key:= #65; opcja:= 2; end;
if (tekst[x] = 'ć') then begin key:= #67; opcja:= 1; end;
if (tekst[x] = 'Ć') then begin key:= #67; opcja:= 2; end;
if (tekst[x] = 'ę') then begin key:= #69; opcja:= 1; end;
if (tekst[x] = 'Ę') then begin key:= #69; opcja:= 2; end;
if (tekst[x] = 'ł') then begin key:= #76; opcja:= 1; end;
if (tekst[x] = 'Ł') then begin key:= #76; opcja:= 2; end;
if (tekst[x] = 'ń') then begin key:= #78; opcja:= 1; end;
if (tekst[x] = 'Ń') then begin key:= #78; opcja:= 2; end;
if (tekst[x] = 'ó') then begin key:= #79; opcja:= 1; end;
if (tekst[x] = 'Ó') then begin key:= #79; opcja:= 2; end;
if (tekst[x] = 'ś') then begin key:= #83; opcja:= 1; end;
if (tekst[x] = 'Ś') then begin key:= #83; opcja:= 2; end;
if (tekst[x] = 'ż') then begin key:= #90; opcja:= 1; end;
if (tekst[x] = 'Ż') then begin key:= #90; opcja:= 2; end;
if (tekst[x] = 'ź') then begin key:= #88; opcja:= 1; end;
if (tekst[x] = 'Ź') then begin key:= #88; opcja:= 2; end;
{TU POWINNY BYĆ KODY znaków specjalnych (oczywiście
ale nic nie wyświetla :( przykład: }
if (tekst[x] = '?') then begin key:= #47; opcja:= 3; end; //kod kropki
if (tekst[x] = '<') then begin key:= #44; opcja:= 3; end; //kod przecinka
//itd.. itd...
//klawisz litery z Altem (polskie litery - male)
if opcja = 1 then
begin
keybd_event(VK_RMENU, 0, 0, 0); //naciśnięty lewy Alt
PostKeyEx32(Ord(key),sst,True);
keybd_event(VK_RMENU, 0, KEYEVENTF_KEYUP, 0); //puszczony lewy Alt
end;
//klawisz litery z Shiftem i Altem (polskie litery - duze)
if opcja = 2 then
begin
keybd_event(VK_LSHIFT, 0, 0, 0); //naciśnięty lewy Shift
keybd_event(VK_RMENU, 0, 0, 0); //naciśnięty lewy Alt
PostKeyEx32(Ord(key),sst,True);
keybd_event(VK_RMENU, 0, KEYEVENTF_KEYUP, 0); //puszczony lewy Alt
keybd_event(VK_LSHIFT, 0, KEYEVENTF_KEYUP, 0); //puszczony lewy Shift
end;
//klawisz litery z Shiftem (znaki specjalne)
if opcja = 3 then
begin
keybd_event(VK_LSHIFT, 0, 0, 0); //naciśnięty lewy Shift
PostKeyEx32(Ord(key),sst,True);
keybd_event(VK_LSHIFT, 0, KEYEVENTF_KEYUP, 0); //puszczony lewy Shift
end;
//standardowe litery - duże i małe
if opcja = 0 then
begin
key:= UpCase(tekst[x]);
if key = tekst[x] then sst:= sst + [ssShift];
PostKeyEx32(Ord(key),sst,True);
end;
end;
End;