Changed capture button
This commit is contained in:
parent
6f406eebfc
commit
847728e7d4
|
@ -49,6 +49,7 @@ You can also use the emulator without graphics by using `uxncli`. You can find a
|
||||||
|
|
||||||
- `ctrl+h` toggle inspector
|
- `ctrl+h` toggle inspector
|
||||||
- `alt+h` toggle zoom
|
- `alt+h` toggle zoom
|
||||||
|
- `caps+h` capture screen
|
||||||
|
|
||||||
## Need a hand?
|
## Need a hand?
|
||||||
|
|
||||||
|
|
13
src/uxnemu.c
13
src/uxnemu.c
|
@ -85,7 +85,7 @@ togglezoom(Uxn *u)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
save_screenshot(void)
|
screencapture(void)
|
||||||
{
|
{
|
||||||
const Uint32 format = SDL_PIXELFORMAT_ARGB8888;
|
const Uint32 format = SDL_PIXELFORMAT_ARGB8888;
|
||||||
int w, h;
|
int w, h;
|
||||||
|
@ -94,6 +94,7 @@ save_screenshot(void)
|
||||||
SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch);
|
SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch);
|
||||||
SDL_SaveBMP(surface, "screenshot.bmp");
|
SDL_SaveBMP(surface, "screenshot.bmp");
|
||||||
SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
|
printf("Saved screenshot.bmp\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -186,13 +187,13 @@ doctrl(Uxn *u, SDL_Event *event, int z)
|
||||||
{
|
{
|
||||||
Uint8 flag = 0x00;
|
Uint8 flag = 0x00;
|
||||||
if(z && event->key.keysym.sym == SDLK_h) {
|
if(z && event->key.keysym.sym == SDLK_h) {
|
||||||
if(SDL_GetModState() & KMOD_LCTRL)
|
if(SDL_GetModState() & KMOD_CAPS)
|
||||||
|
screencapture();
|
||||||
|
else if(SDL_GetModState() & KMOD_LCTRL)
|
||||||
toggledebug(u);
|
toggledebug(u);
|
||||||
if(SDL_GetModState() & KMOD_LALT)
|
else if(SDL_GetModState() & KMOD_LALT)
|
||||||
togglezoom(u);
|
togglezoom(u);
|
||||||
} else if(z && event->key.keysym.sym == SDLK_s)
|
}
|
||||||
if(SDL_GetModState() & KMOD_LCTRL)
|
|
||||||
save_screenshot();
|
|
||||||
switch(event->key.keysym.sym) {
|
switch(event->key.keysym.sym) {
|
||||||
case SDLK_LCTRL: flag = 0x01; break;
|
case SDLK_LCTRL: flag = 0x01; break;
|
||||||
case SDLK_LALT: flag = 0x02; break;
|
case SDLK_LALT: flag = 0x02; break;
|
||||||
|
|
Loading…
Reference in New Issue