GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5a018b1
)
Keyboard shortcuts
author
Tomas Mudrunka
<tomas@mudrunka.cz>
Thu, 16 Jul 2020 14:07:42 +0000
(16:07 +0200)
committer
Tomas Mudrunka
<tomas@mudrunka.cz>
Thu, 16 Jul 2020 14:07:42 +0000
(16:07 +0200)
c/SDL2_putpixel_click/main.c
patch
|
blob
|
blame
|
history
diff --git
a/c/SDL2_putpixel_click/main.c
b/c/SDL2_putpixel_click/main.c
index 8032752b1a90e8ea21871982cf8b4e3000fca75b..a1955edca17e074934f2dcc1e7c8c96621eb4d29 100644
(file)
--- a/
c/SDL2_putpixel_click/main.c
+++ b/
c/SDL2_putpixel_click/main.c
@@
-29,6
+29,8
@@
int main(void) {
int running = 1;
int mouseX, mouseY;
int running = 1;
int mouseX, mouseY;
+ Uint32 fullscreen_status = 0;
+
while(running) {
event.type = 0;
if(SDL_PollEvent(&event)) {
while(running) {
event.type = 0;
if(SDL_PollEvent(&event)) {
@@
-39,6
+41,16
@@
int main(void) {
case SDL_KEYDOWN:
//case SDL_KEYUP:
printf("Key: %d\t%d\t%d\n", event.key.keysym.scancode, event.key.keysym.sym, event.key.keysym.mod );
case SDL_KEYDOWN:
//case SDL_KEYUP:
printf("Key: %d\t%d\t%d\n", event.key.keysym.scancode, event.key.keysym.sym, event.key.keysym.mod );
+
+ if(event.key.keysym.scancode == SDL_SCANCODE_F && event.key.keysym.mod == KMOD_LCTRL) {
+ fullscreen_status = fullscreen_status ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP;
+ SDL_SetWindowFullscreen(window, fullscreen_status);
+ }
+
+ if(event.key.keysym.scancode == SDL_SCANCODE_Q && event.key.keysym.mod == KMOD_LCTRL) {
+ running = 0;
+ }
+
break;
case SDL_MOUSEBUTTONDOWN:
//do whatever you want to do after a mouse button was pressed,
break;
case SDL_MOUSEBUTTONDOWN:
//do whatever you want to do after a mouse button was pressed,
This page took
0.19565 seconds
and
4
git commands to generate.