Author: Jonas Bilinkevicius
Is there a way to change the decimal point (.) on the numeric keypad to a comma (,)
on the application level?
Answer:
You can use a handler for the Application.OnMessage event. Changing the decimal
separator produced by numpad globally:
1 2 procedure TForm1.AppOnMessage(var Msg: TMsg; var Handled: Boolean);
3 begin4 case Msg.messageof5 WM_KEYDOWN, WM_KEYUP:
6 if (Msg.wparam = VK_DECIMAL) and (Odd(GetKeyState(VK_NUMLOCK))) then7 begin8 Msg.wparam := 190; { for point, use 188 for comma }9 Msg.lparam := MakeLParam(LoWord(msg.lparam), (HiWord(Msg.lparam)
10 and $FE00) + MapVirtualKey(Msg.wparam, 0));
11 end;
12 end;
13 end;