 93a131661d
			
		
	
	
		93a131661d
		
	
	
	
	
		
			
			# Objective - Added a bunch of backticks to things that should have them, like equations, abstract variable names, - Changed all small x, y, and z to capitals X, Y, Z. This might be more annoying than helpful; Feel free to refuse this PR.
		
			
				
	
	
		
			24 lines
		
	
	
		
			623 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			623 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //! Demonstrates using key modifiers (ctrl, shift).
 | |
| 
 | |
| use bevy::{
 | |
|     input::{keyboard::KeyCode, Input},
 | |
|     prelude::*,
 | |
| };
 | |
| 
 | |
| fn main() {
 | |
|     App::new()
 | |
|         .add_plugins(DefaultPlugins)
 | |
|         .add_system(keyboard_input_system)
 | |
|         .run();
 | |
| }
 | |
| 
 | |
| /// This system prints when `Ctrl + Shift + A` is pressed
 | |
| fn keyboard_input_system(input: Res<Input<KeyCode>>) {
 | |
|     let shift = input.any_pressed([KeyCode::LShift, KeyCode::RShift]);
 | |
|     let ctrl = input.any_pressed([KeyCode::LControl, KeyCode::RControl]);
 | |
| 
 | |
|     if ctrl && shift && input.just_pressed(KeyCode::A) {
 | |
|         info!("Just pressed Ctrl + Shift + A!");
 | |
|     }
 | |
| }
 |