File tree Expand file tree Collapse file tree 2 files changed +27
-28
lines changed
app/src/core/service/controlService Expand file tree Collapse file tree 2 files changed +27
-28
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,20 @@ export class ControllerCameraClass extends ControllerClass {
4242 return ;
4343 }
4444 const key = event . key . toLowerCase ( ) ;
45+
46+ // 视野缩放:起飞(放大)
47+ if ( key === "[" || key === "【" ) {
48+ this . project . camera . isStartZoomIn = true ;
49+ this . project . camera . addScaleFollowMouseLocationTime ( 1 ) ;
50+ return ;
51+ }
52+ // 视野缩放:降落(缩小)
53+ if ( key === "]" || key === "】" ) {
54+ this . project . camera . isStartZoomOut = true ;
55+ this . project . camera . addScaleFollowMouseLocationTime ( 1 ) ;
56+ return ;
57+ }
58+
4559 if ( ControllerCameraClass . keyMap [ key ] && Settings . allowMoveCameraByWSAD ) {
4660 if ( this . project . controller . pressingKeySet . has ( "control" ) || this . project . controller . pressingKeySet . has ( "meta" ) ) {
4761 // ctrl按下时,可能在按 ctrl+s 保存,防止出现冲突
@@ -86,6 +100,19 @@ export class ControllerCameraClass extends ControllerClass {
86100 }
87101 // ------
88102
103+ // 停止视野缩放:起飞
104+ if ( key === "[" || key === "【" ) {
105+ this . project . camera . isStartZoomIn = false ;
106+ this . project . camera . addScaleFollowMouseLocationTime ( 5 ) ;
107+ return ;
108+ }
109+ // 停止视野缩放:降落
110+ if ( key === "]" || key === "】" ) {
111+ this . project . camera . isStartZoomOut = false ;
112+ this . project . camera . addScaleFollowMouseLocationTime ( 5 ) ;
113+ return ;
114+ }
115+
89116 if ( ControllerCameraClass . keyMap [ key ] && Settings . allowMoveCameraByWSAD ) {
90117 if ( this . isPressingCtrlOrMeta ) {
91118 // ctrl按下时,可能在按 ctrl+s 保存,防止出现冲突
Original file line number Diff line number Diff line change @@ -178,34 +178,6 @@ export const allKeyBinds: KeyBindItem[] = [
178178 defaultKey : "C-A-r" ,
179179 onPress : ( project ) => project ! . camera . resetScale ( ) ,
180180 } ,
181- {
182- id : "CameraScaleZoomIn" ,
183- defaultKey : "[" ,
184- onPress : ( project ) => {
185- // if (!project!.keyboardOnlyEngine.isOpenning()) return;
186- // project!.camera.zoomInByKeyboardPress();
187- project ! . camera . isStartZoomIn = true ;
188- project ! . camera . addScaleFollowMouseLocationTime ( 1 ) ;
189- } ,
190- onRelease : ( project ) => {
191- project ! . camera . isStartZoomIn = false ;
192- project ! . camera . addScaleFollowMouseLocationTime ( 5 ) ;
193- } ,
194- } ,
195- {
196- id : "CameraScaleZoomOut" ,
197- defaultKey : "]" ,
198- onPress : ( project ) => {
199- // if (!project!.keyboardOnlyEngine.isOpenning()) return;
200- // project!.camera.zoomOutByKeyboardPress();
201- project ! . camera . isStartZoomOut = true ;
202- project ! . camera . addScaleFollowMouseLocationTime ( 1 ) ;
203- } ,
204- onRelease : ( project ) => {
205- project ! . camera . isStartZoomOut = false ;
206- project ! . camera . addScaleFollowMouseLocationTime ( 5 ) ;
207- } ,
208- } ,
209181
210182 /*------- 相机分页移动(Win) -------*/
211183 // 注意:实际运行时会根据 isMac 注册其一,这里两份都列出方便查阅
You can’t perform that action at this time.
0 commit comments