[Feature request] Differentiate between numeric keys and the numpad

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

[Feature request] Differentiate between numeric keys and the numpad

Post by Hologram »

For keyboard shortcuts, it would be helpful to differentiate between the numerical row of keys and the numpad. This extends the number of available keys by a lot, especially if you take the modifier key combinations into account. The numpad could be used for macros or, as I like to do, for view navigation. Think of it as an unfolded cube and pressing any of the buttons gets you the associated view:

Back = 8
Top = 5
Front = 2
Bottom = 0
Left =4 and Right = 6

At the same time, I would like to use the numeric key row for other purposes to activate commands with a single hotkey. But at the moment, that's not possible, it seems.

Any thoughts on the feasibility of this? Is there a technical reason why the numeric keys and numpad share the same keys when used in keyboard shortcuts?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Feature request] Differentiate between numeric keys and the numpad

Post by adrianinsaval »

I think it's possible to differentiate numpad keys from regular keys, we are already doing it for decimal separator substitution, I do not if it's easy to implement as customizable shortcuts though
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

Re: [Feature request] Differentiate between numeric keys and the numpad

Post by Hologram »

adrianinsaval wrote: Wed Feb 01, 2023 12:30 pm I do not if it's easy to implement as customizable shortcuts though
Some software do, some don't. For some it is near impossible for others it is easy. It can be pretty illusive for some reason. Blender does this very well, that's all I can say.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Feature request] Differentiate between numeric keys and the numpad

Post by openBrain »

adrianinsaval wrote: Wed Feb 01, 2023 12:30 pm I think it's possible to differentiate numpad keys from regular keys, we are already doing it for decimal separator substitution, I do not if it's easy to implement as customizable shortcuts though
It's look doable pretty easily.
However, I think we have to provide user a way to ignore it, being able for example to set a shortcut as being "1" being it entered from normal or numerical keypad.
This isn't so easy a problem to solve when talking of having it in an input field which goal is to catch almost any key press. :)
I'm open to suggestions on this point. Then I can do a draft PR if one want to test.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Feature request] Differentiate between numeric keys and the numpad

Post by adrianinsaval »

Not differentiated by default and add a checkbox for differentiating bellow the input field? How do other software handle this?
Hologram
Posts: 201
Joined: Thu Nov 03, 2022 3:05 pm

Re: [Feature request] Differentiate between numeric keys and the numpad

Post by Hologram »

openBrain wrote: Wed Feb 08, 2023 10:42 am It's look doable pretty easily.
However, I think we have to provide user a way to ignore it, being able for example to set a shortcut as being "1" being it entered from normal or numerical keypad.
This isn't so easy a problem to solve when talking of having it in an input field which goal is to catch almost any key press. :)
I'm open to suggestions on this point. Then I can do a draft PR if one want to test.
From a user perspective, this wouldn't be that difficult. Add a preference option whether or not a user has a numpad. When "use dedicated numpad button recognition" (needs to be renamed to something more sensible) is unchecked, it will record keystrokes the way it does now (numpad = numeric row). If the button is checked, numpad keys are recognised as different keys than numeric keys. Basically a should @openBrain's PR be applied [yes/ no].

To make it more discoverable, the checkbox should be in the keyboard shortcut editor. However, because this is a set and forget option, I'd argue you should put it in the preferences. Hope this helps.

E: @adrianinsaval other software usually differentiate between the two and allow you to set multiple hotkeys per tool. That way, you can set both numpad and numeric keys to the same command if you need to. Or they don't differentiate between the two. But I don't see any problem in splitting the two up, by default don't use the numpad for any shortcuts and it should be fine for people who don't have a numpad. In the meantime, you could do use the checkbox mentioned above. I have remapped (customised) over a dozen large pieces of software so you can trust me on this ;)
Post Reply