Merge pull request #513 from technomancy/ctrl-page
Use ctrl-pageup/pagedown to cycle thru modes.
This commit is contained in:
		
							
								
								
									
										21
									
								
								src/studio.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								src/studio.c
									
									
									
									
									
								
							@@ -1027,6 +1027,19 @@ EditorMode getStudioMode()
 | 
				
			|||||||
	return studio.mode;
 | 
						return studio.mode;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void changeStudioMode(s32 dir)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    const size_t modeCount = sizeof(Modes)/sizeof(Modes[0]);
 | 
				
			||||||
 | 
					    for(size_t i = 0; i < modeCount; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if(studio.mode == Modes[i])
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            setStudioMode(Modes[(i+dir+modeCount) % modeCount]);
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void showGameMenu()
 | 
					static void showGameMenu()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	studio.tic->api.pause(studio.tic);
 | 
						studio.tic->api.pause(studio.tic);
 | 
				
			||||||
@@ -1777,6 +1790,14 @@ static bool processShortcuts(SDL_KeyboardEvent* event)
 | 
				
			|||||||
		default:  break;
 | 
							default:  break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					    else if(mod & KMOD_LCTRL)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        switch(event->keysym.sym)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        case SDLK_PAGEUP: changeStudioMode(-1); return true;
 | 
				
			||||||
 | 
					        case SDLK_PAGEDOWN: changeStudioMode(1); return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		switch(event->keysym.sym)
 | 
							switch(event->keysym.sym)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user