How to view the view with Z key like 3dmax?

How to make “Frame Selected” and “view3d. viewall” switch with “Z” key at the same time, and the operation experience is like 3dmax.

First, execute “Frame Selected” first when an object is selected, and “view3d. viewall” when no object is selected“

QQ图片20230123120646

I think it can only be fully realized by using code to make realistic judgments

Change the hotkeys in the keymap editor under View3d > View3D (Global)

Thank you for your reply

I have set in Keymap that the Z key is executed with “Press”. The first one is useful and the second one cannot be used. The latter one must be executed with other commands. Not the effect I want.
QQ图片20230123120646

I think it can only be fully realized by using code to make realistic judgments

Change Press on one of them to Release. But to save yourself a headache, it’s better to use F for Frame Selected. Having them both mapped to the same button will just cause problems.

If i understand you correctly you want “frame all or selected” from kekit’s blender add-on…

  1. When there is a selected object, press the “z” key to maximize the display of the selected object.
    a1
  2. When there are no selected objects, press the “z” key to maximize the display of all objects.
    a2

They all need “z” key, press once

kekit, I installed in the blender version 2.9-3.5 has errors, so I can’t experience it, so I don’t know it.

Yes thats what kekits operator does, as @impacman said. You can test it by using the operator search. Or directly change your shortcut, its exactly that.

Edit: Sorry I overread the error you mentioned.

thank you!
“kekit” There are errors in blender 2.9-3.5 on my computer. Maybe I didn’t find the correct version.

Do you know the version number

kekit_v2_17

Hmm, 2.17 works here under 3.5 alpha. Did you close blender and reopen and tried activating again?

I’m careless, blender 3.5 has not been installed before. It has just been installed and works normally. Thank you for reply!

It should have worked with 3.3 aswell, but good if its working now.

Use screen.ke_frame_view