개정판 f87dfb18
Issue #200114 CTRL+방향키로 페이지의 Center 이동
- 뱡향키 사용시 컨트롤의 포커스가 변경되는 경우가 발생
CTRL+마우스 휠 페이지번호 변경
Change-Id: I7804b9fdf9a0720393a682a8183d9192ef43c8a3
KCOM/Events/Event_KeyEvent.cs | ||
---|---|---|
25 | 25 |
|
26 | 26 |
public void KeyEventDownAction(object sender, KeyEventArgs e) |
27 | 27 |
{ |
28 |
if (e.IsRepeat) |
|
28 |
if (e.IsRepeat && !ViewerDataModel.Instance.IsPressCtrl && !ViewerDataModel.Instance.IsPressShift)
|
|
29 | 29 |
return; |
30 |
|
|
30 | 31 |
switch (e.Key) |
31 | 32 |
{ |
32 | 33 |
//강인구 추가 |
... | ... | |
252 | 253 |
case Key.Up: |
253 | 254 |
case Key.Down: |
254 | 255 |
{ |
255 |
if (this.dzMainMenu.SelectLayer.Children.Count > 0) |
|
256 |
Point? MovePoint = null; |
|
257 |
if ((e.Key == Key.NumPad5) || (e.Key == Key.Down)) |
|
256 | 258 |
{ |
257 |
Point? control = null; |
|
258 |
if ((ViewerDataModel.Instance.IsPressShift && (e.Key == Key.NumPad5)) || (e.Key == Key.Down)) |
|
259 |
{ |
|
260 |
control = new Point(0, 5); |
|
261 |
} |
|
262 |
else if ((ViewerDataModel.Instance.IsPressShift && (e.Key == Key.NumPad8)) || (e.Key == Key.Up)) |
|
263 |
{ |
|
264 |
control = new Point(0, -5); |
|
265 |
} |
|
266 |
else if ((ViewerDataModel.Instance.IsPressShift && (e.Key == Key.NumPad4)) || (e.Key == Key.Left)) |
|
259 |
MovePoint = new Point(0, 5); |
|
260 |
} |
|
261 |
else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up)) |
|
262 |
{ |
|
263 |
MovePoint = new Point(0, -5); |
|
264 |
} |
|
265 |
else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left)) |
|
266 |
{ |
|
267 |
MovePoint = new Point(-5, 0); |
|
268 |
} |
|
269 |
else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right)) |
|
270 |
{ |
|
271 |
MovePoint = new Point(5, 0); |
|
272 |
} |
|
273 |
|
|
274 |
if (MovePoint != null && MovePoint.HasValue) |
|
275 |
{ |
|
276 |
if (this.dzMainMenu.SelectLayer.Children.Count > 0 && ViewerDataModel.Instance.IsPressShift) |
|
267 | 277 |
{ |
268 |
control = new Point(-5, 0); |
|
278 |
|
|
279 |
this.TranslateOrRotateItems(MovePoint.Value, this.dzMainMenu.rotate.Angle); |
|
269 | 280 |
} |
270 |
else if ((ViewerDataModel.Instance.IsPressShift && (e.Key == Key.NumPad6)) || (e.Key == Key.Right))
|
|
281 |
else |
|
271 | 282 |
{ |
272 |
control = new Point(5, 0); |
|
283 |
if (ViewerDataModel.Instance.IsPressCtrl) |
|
284 |
{ |
|
285 |
bool IsMovePossibility = false; |
|
286 |
|
|
287 |
var instance = ViewerDataModel.Instance; |
|
288 |
|
|
289 |
if ((e.Key == Key.NumPad5) || (e.Key == Key.Down)) |
|
290 |
{ |
|
291 |
if (instance.ContentHeight > instance.ContentOffsetY) |
|
292 |
{ |
|
293 |
IsMovePossibility = true; |
|
294 |
} |
|
295 |
} |
|
296 |
else if ((e.Key == Key.NumPad8) || (e.Key == Key.Up)) |
|
297 |
{ |
|
298 |
if (0 < instance.ContentOffsetY) |
|
299 |
{ |
|
300 |
IsMovePossibility = true; |
|
301 |
} |
|
302 |
} |
|
303 |
else if ((e.Key == Key.NumPad4) || (e.Key == Key.Left)) |
|
304 |
{ |
|
305 |
if (0 < instance.ContentOffsetX) |
|
306 |
{ |
|
307 |
IsMovePossibility = true; |
|
308 |
} |
|
309 |
} |
|
310 |
else if ((e.Key == Key.NumPad6) || (e.Key == Key.Right)) |
|
311 |
{ |
|
312 |
if (instance.ContentWidth > instance.ContentOffsetX) |
|
313 |
{ |
|
314 |
IsMovePossibility = true; |
|
315 |
} |
|
316 |
} |
|
317 |
|
|
318 |
if (IsMovePossibility) |
|
319 |
{ |
|
320 |
Vector dragOffset = new Vector(MovePoint.Value.X * -10, MovePoint.Value.Y * -10); |
|
321 |
|
|
322 |
this.dzMainMenu.MoveZoomAndPanControl(dragOffset); |
|
323 |
|
|
324 |
this.dzMainMenu.MainDocumentPanel.Focus(); |
|
325 |
|
|
326 |
System.Diagnostics.Debug.WriteLine(this.dzMainMenu.zoomAndPanControl.ContentOffsetX); |
|
327 |
} |
|
328 |
} |
|
273 | 329 |
} |
274 |
if(control != null && control.HasValue) this.TranslateOrRotateItems(control.Value, this.dzMainMenu.rotate.Angle); |
|
275 | 330 |
} |
276 | 331 |
} |
277 | 332 |
break; |
... | ... | |
286 | 341 |
} |
287 | 342 |
} |
288 | 343 |
|
344 |
|
|
289 | 345 |
/// <summary> |
290 | 346 |
/// translate or rotate items by given pt and angle |
291 | 347 |
/// </summary> |
내보내기 Unified diff