[Solved] Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
rmn_hr
Posts: 114
Joined: Sun Jun 26, 2022 7:54 pm

[Solved] Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by rmn_hr »

@openBrain (with greetings from chrisb)

This topic is discussed in the german forum with chrisb.
He repeated this 'side effect' with his FreeCAD-configuration, in Part-Workbench, setting for language: English.

I found this effect while using PartDesign in version 0.21.30398, language setting: German.
View Rear is in German: Ansicht Hinten -> Shortcut A,H seems a good choice for me

The effect is present in the new weekly 30430 also

Here the results of chrisb's testing

- starting FreeCAD with a new config
- for testing he designed in Part-WB a simple cone -> no reaction on key-stroke 'R'
- Tools > Customize > Keyboard > select Standard View
- assign key 'H' to Bottom and OK

- Test1: press key 'R' -> still no reaction
- press Key 'H' -> View showing Bottom View
- Test2: rotating the view, press key 'R' -> View moves to 'View Bottom'.

During my testings I assigned key 'H' to several views as one-key-stroke or as part of a sequence.
Whenever key 'H' was activated, key 'R' is assigned to a view (some times random, mostly to the view where 'H' is used)

Following his short testing of the issue, chrisb asked me to forward the topic to you.
Maybe you will have a look on it.

Thank's and kind regards


my FreeCAD-Setup:

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.30398 (Git)
Build type: Release
Branch: master
Hash: b3dfdc568a92810449bf47bc73b6784d65dfa206
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Last edited by rmn_hr on Thu Oct 06, 2022 7:03 pm, edited 1 time in total.
My workflow: create single components in PartDesign and arrange them with Zolko's Assembly4
(https://github.com/Zolko-123/FreeCAD_Assembly4 )

FreeCAD works pretty well and stable for me !! :)
Hymn of Praise valid again since FreeCAD 0.22.35449
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by chrisb »

It needs the mention tag to ping someone. @openBrain
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by adrianinsaval »

Another user also had a similar problem: https://forum.freecadweb.org/viewtopic. ... lit=rotate
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by openBrain »

rmn_hr wrote: Fri Sep 23, 2022 9:01 pm @openBrain (with greetings from chrisb)
Kind of friends that calls you when there is a problem. :lol:
- starting FreeCAD with a new config
- for testing he designed in Part-WB a simple cone -> no reaction on key-stroke 'R'
- Tools > Customize > Keyboard > select Standard View
- assign key 'H' to Bottom and OK

- Test1: press key 'R' -> still no reaction
- press Key 'H' -> View showing Bottom View
- Test2: rotating the view, press key 'R' -> View moves to 'View Bottom'.

During my testings I assigned key 'H' to several views as one-key-stroke or as part of a sequence.
Whenever key 'H' was activated, key 'R' is assigned to a view (some times random, mostly to the view where 'H' is used)

Following his short testing of the issue, chrisb asked me to forward the topic to you.
Maybe you will have a look on it.
OK, you guys are crazy at finding issues. :) This one is real and very specific.
It comes from a hardcoded behavior in NavigationStyle (the mother of all navigation styles, so you will get it whatever is your setting).
You can see it here -- don't be afraid, it's pretty easy -- : https://github.com/FreeCAD/FreeCAD/blob ... 1617-L1624
Actually you see that when pressing 'H', you save your "home position". Then when pressing "R", you recall the said position.
My own opinion is that this is really not good that this is hardcoded here, and if such function is useful for users, it should go to specific 'save' and 'recall' functions available in the menus/toolbars. So that first it is clearly exposed to user, and second you can change the shortcut. Also it would allow the internal checking mechanism to catch the shortcut interference.
Anyway, will ping @wmayer to check he agrees with this solution before going to code a PR. :)
User avatar
rmn_hr
Posts: 114
Joined: Sun Jun 26, 2022 7:54 pm

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by rmn_hr »

openBrain wrote: Sat Sep 24, 2022 6:18 am
rmn_hr wrote: Fri Sep 23, 2022 9:01 pm
OK, you guys are crazy at finding issues. :) This one is real and very specific.
It comes from a hardcoded behavior in NavigationStyle (the mother of all navigation styles, so you will get it whatever is your setting).
You can see it here -- don't be afraid, it's pretty easy -- : https://github.com/FreeCAD/FreeCAD/blob ... 1617-L1624
Actually you see that when pressing 'H', you save your "home position". Then when pressing "R", you recall the said position.
My own opinion is that this is really not good that this is hardcoded here, and if such function is useful for users, it should go to specific 'save' and 'recall' functions available in the menus/toolbars. So that first it is clearly exposed to user, and second you can change the shortcut. Also it would allow the internal checking mechanism to catch the shortcut interference.
Anyway, will ping @wmayer to check he agrees with this solution before going to code a PR. :)
Thank's for this excellent information - chrisb just knows whom to ask special questions ;)
My work-around avoiding 'H' and 'R' for selecting a standard-view: I changed to A,D (Ansicht, a droite) and A,G (Ansicht,a gauche). Mixing up german and some part of french works preety good -> no problems with key 'R'.

But the 'problem' is still there - I guess, the raising number of FreeCAD-user optimizing their workflow by defining shortcuts will bring up this or similar questions more often

I can work very well with my german-french work-around, just knowing my FreeCAD configuration is not the reason for this behaviour.
Thank's again and kindest regards
My workflow: create single components in PartDesign and arrange them with Zolko's Assembly4
(https://github.com/Zolko-123/FreeCAD_Assembly4 )

FreeCAD works pretty well and stable for me !! :)
Hymn of Praise valid again since FreeCAD 0.22.35449
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by chrisb »

Additional information: When I switch to Sketcher workbench, I see the following message. This happens even with plain vanilla configs, system and user. I think it is so since I tested the shortcuts, so my question is, if there some information stored elsewhere.

Code: Select all

07:47:03  Traceback (most recent call last):
07:47:03    File "<string>", line 737, in applyShortcuts
07:47:03    File "<string>", line 245, in globalShortcuts
07:47:03  ValueError: Empty group name
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by chrisb »

openBrain wrote: Sat Sep 24, 2022 6:18 am Kind of friends that calls you when there is a problem. :lol:
Sorry, it will happen again :mrgreen: .

I had suspected the H key from gesture mode, but rejected the idea, because rmn_hr used CAD mode. Storing the current 3D position sounds interesting, but I agree that it should not be hardcoded, and if it does, then it shouldn't be possible to use H key as some other shortcut.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by openBrain »

chrisb wrote: Sat Sep 24, 2022 9:01 am Additional information: When I switch to Sketcher workbench, I see the following message. This happens even with plain vanilla configs, system and user. I think it is so since I tested the shortcuts, so my question is, if there some information stored elsewhere.
Can you give FC info please ? These functions seem to no more exist in latest master.

EDIT : most probably it's an add-on actually
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by chrisb »

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.30398 (Git)
Build type: Release
Branch: master
Hash: b3dfdc568a92810449bf47bc73b6784d65dfa206
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * ShortCuts
  * fasteners 0.4.6
  * sheetmetal 0.2.57
  * ExplodedAssembly
  * Curves 0.5.8
I'm just downloading 30430 for a retest.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Shortcuts for Views: Key 'H' activates key 'R' as shortcut for same or random view

Post by openBrain »

chrisb wrote: Sat Sep 24, 2022 9:13 am I'm just downloading 30430 for a retest.
Can you disable 'Shortcuts' add-on ?
Post Reply