mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	When testing for a key press, rather check for the modifier keys
(alt, ctrl) always. Also if a key event is not processed, pass it for further processing.
This commit is contained in:
		
							parent
							
								
									53d08d1883
								
							
						
					
					
						commit
						dabcff1c07
					
				
					 3 changed files with 50 additions and 33 deletions
				
			
		|  | @ -89,20 +89,26 @@ sub new { | |||
|     EVT_KEY_DOWN($canvas, sub { | ||||
|         my ($s, $event) = @_; | ||||
|         my $key = $event->GetKeyCode; | ||||
|         if ($key == ord('U') || $key == WXK_RIGHT) { | ||||
|             $slider_high->SetValue($slider_high->GetValue + 1); | ||||
|             $slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown()); | ||||
|             $self->set_z_idx_high($slider_high->GetValue); | ||||
|         } elsif ($key == ord('D') || $key == WXK_LEFT) { | ||||
|             $slider_high->SetValue($slider_high->GetValue - 1); | ||||
|             $slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown()); | ||||
|             $self->set_z_idx_high($slider_high->GetValue); | ||||
|         } elsif ($key == ord('S')) { | ||||
|             $checkbox_singlelayer->SetValue(! $checkbox_singlelayer->GetValue()); | ||||
|             $self->single_layer($checkbox_singlelayer->GetValue()); | ||||
|             if ($self->single_layer) { | ||||
|                 $slider_low->SetValue($slider_high->GetValue); | ||||
|         if ($event->HasModifiers) { | ||||
|             $event->Skip; | ||||
|         } else { | ||||
|             if ($key == ord('U') || $key == WXK_RIGHT) { | ||||
|                 $slider_high->SetValue($slider_high->GetValue + 1); | ||||
|                 $slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown()); | ||||
|                 $self->set_z_idx_high($slider_high->GetValue); | ||||
|             } elsif ($key == ord('D') || $key == WXK_LEFT) { | ||||
|                 $slider_high->SetValue($slider_high->GetValue - 1); | ||||
|                 $slider_low->SetValue($slider_high->GetValue) if ($event->ShiftDown()); | ||||
|                 $self->set_z_idx_high($slider_high->GetValue); | ||||
|             } elsif ($key == ord('S')) { | ||||
|                 $checkbox_singlelayer->SetValue(! $checkbox_singlelayer->GetValue()); | ||||
|                 $self->single_layer($checkbox_singlelayer->GetValue()); | ||||
|                 if ($self->single_layer) { | ||||
|                     $slider_low->SetValue($slider_high->GetValue); | ||||
|                     $self->set_z_idx_high($slider_high->GetValue); | ||||
|                 } | ||||
|             } else { | ||||
|                 $event->Skip; | ||||
|             } | ||||
|         } | ||||
|     }); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv