Numeric Text Field VK_PERIOD to VK_COMMA

Hi,
I have Float4 memory tag and Numeric Text Field with bidirectional binding.
If I enter 2,55(with comma) to Numeric Text Field, everything is ok. But if I enter 2.55 (with period) by mistake, I will get value 255.
I tried to replace “period” to “comma” such script:
if event.keyCode == event.VK_PERIOD:
event.keyCode = event.VK_COMMA

But with no luck.
How can I replace “period” to “comma” during enter?

You can use the Java Robot to erase the period and enter a comma:

[code]from java.awt import Robot
from java.awt.event import KeyEvent

if event.keyCode == event.VK_PERIOD:
rob = Robot()
rob.keyPress(KeyEvent.VK_BACK_SPACE)
rob.keyPress(KeyEvent.VK_COMMA)[/code]

Thank you, great solution!