diff -r 46da2ea29023 -r c9252721680b src/eric7/QScintilla/Editor.py --- a/src/eric7/QScintilla/Editor.py Thu May 16 17:14:26 2024 +0200 +++ b/src/eric7/QScintilla/Editor.py Sun May 19 17:48:07 2024 +0200 @@ -37,6 +37,7 @@ QActionGroup, QCursor, QFont, + QKeyEvent, QPainter, QPalette, QPixmap, @@ -8085,6 +8086,26 @@ self.endUndoAction() self.setSelection(sline, sindex + 1, eline, eindex + 1) + if ( + ev.key() == Qt.Key.Key_Comma + and ev.modifiers() & Qt.KeyboardModifier.KeypadModifier + ): + # Change the numpad ',' to always insert a '.' because that is what + # is needed in programming. + + # Create a new QKeyEvent to substitute the original one + ev = QKeyEvent( + ev.type(), + Qt.Key.Key_Period, + ev.modifiers(), + ".", + ev.isAutoRepeat(), + ev.count(), + ) + + super().keyPressEvent(ev) + return + txt = ev.text() # See it is text to insert.