Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

enable numpad

shun_iwasawac5b5d29ca2a5
diff --git a/toonz/sources/toonz/sceneviewerevents.cpp b/toonz/sources/toonz/sceneviewerevents.cpp
index fbaea5ea6..7a7a92481 100644
--- a/toonz/sources/toonz/sceneviewerevents.cpp
+++ b/toonz/sources/toonz/sceneviewerevents.cpp
@@ -777,7 +777,8 @@ void SceneViewer::keyPressEvent(QKeyEvent *event) {
// then consider about shortcut for the current style selection.
if (m_isStyleShortcutSwitchable &&
Preferences::instance()->isUseNumpadForSwitchingStylesEnabled() &&
- (!isTextToolActive) && event->modifiers() == Qt::NoModifier &&
+ (!isTextToolActive) && (event->modifiers() == Qt::NoModifier ||
+ event->modifiers() == Qt::KeypadModifier) &&
((Qt::Key_0 <= key && key <= Qt::Key_9) || key == Qt::Key_Tab ||
key == Qt::Key_Backtab)) {
event->ignore();
diff --git a/toonz/sources/toonz/styleshortcutswitchablepanel.cpp b/toonz/sources/toonz/styleshortcutswitchablepanel.cpp
index 4b8ada43a..d68052127 100644
--- a/toonz/sources/toonz/styleshortcutswitchablepanel.cpp
+++ b/toonz/sources/toonz/styleshortcutswitchablepanel.cpp
@@ -26,7 +26,9 @@ void StyleShortcutSwitchablePanel::keyPressEvent(QKeyEvent *event) {
TTool *tool = TApp::instance()->getCurrentTool()->getTool();
if (!tool) return;
if (tool->getName() == T_Type && tool->isActive()) return;
- if (event->modifiers() != Qt::NoModifier) return;
+ if (event->modifiers() != Qt::NoModifier &&
+ event->modifiers() != Qt::KeypadModifier)
+ return;
int key = event->key();
if (Qt::Key_0 <= key && key <= Qt::Key_9) {
TPaletteHandle *ph =