diff options
| author | Joshua Diamond <josh@windowoffire.com> | 2020-06-23 22:02:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-24 12:02:12 +1000 |
| commit | 9b398a8f31e31cd8aed60a2d90ada306213f70f5 (patch) | |
| tree | a8ae34a08b7fd446a355a8580ba6fcd3daa57c55 /users/spidey3 | |
| parent | c30170b868f50e74e52067ea78b184b7ee875be5 (diff) | |
| download | qmk_firmware-9b398a8f31e31cd8aed60a2d90ada306213f70f5.tar.gz qmk_firmware-9b398a8f31e31cd8aed60a2d90ada306213f70f5.zip | |
Partial and window screenshots (#9332)
Diffstat (limited to 'users/spidey3')
| -rw-r--r-- | users/spidey3/spidey3.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/users/spidey3/spidey3.c b/users/spidey3/spidey3.c index 4e364628a..a8dafcb7b 100644 --- a/users/spidey3/spidey3.c +++ b/users/spidey3/spidey3.c | |||
| @@ -192,6 +192,72 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 192 | spi_gflock = !spi_gflock; | 192 | spi_gflock = !spi_gflock; |
| 193 | dprintf("spi_gflock = %u\n", spi_gflock); | 193 | dprintf("spi_gflock = %u\n", spi_gflock); |
| 194 | break; | 194 | break; |
| 195 | |||
| 196 | case KC_PSCR: { | ||
| 197 | uint8_t mods = get_mods(); | ||
| 198 | #ifndef NO_ACTION_ONESHOT | ||
| 199 | uint8_t osm = get_oneshot_mods(); | ||
| 200 | #else | ||
| 201 | uint8_t osm = 0; | ||
| 202 | #endif | ||
| 203 | |||
| 204 | switch (get_unicode_input_mode()) { | ||
| 205 | case UC_MAC: | ||
| 206 | if ((mods | osm) & MOD_MASK_ALT) { | ||
| 207 | // Window screenshot | ||
| 208 | clear_mods(); | ||
| 209 | #ifndef NO_ACTION_ONESHOT | ||
| 210 | clear_oneshot_mods(); | ||
| 211 | #endif | ||
| 212 | tap_code16(LSFT(LGUI(KC_4))); | ||
| 213 | wait_ms(100); | ||
| 214 | tap_code(KC_SPC); | ||
| 215 | set_mods(mods); | ||
| 216 | return false; | ||
| 217 | } else if ((mods | osm) & MOD_MASK_SHIFT) { | ||
| 218 | // Partial screenshot | ||
| 219 | tap_code16(LSFT(LGUI(KC_4))); | ||
| 220 | return false; | ||
| 221 | } else { | ||
| 222 | // Full screenshot | ||
| 223 | tap_code16(LSFT(LGUI(KC_3))); | ||
| 224 | return false; | ||
| 225 | } | ||
| 226 | break; | ||
| 227 | |||
| 228 | case UC_WIN: | ||
| 229 | case UC_WINC: | ||
| 230 | if ((mods | osm) & MOD_MASK_ALT) { | ||
| 231 | // Window screenshot | ||
| 232 | // Alt+PrintScreen should work as is | ||
| 233 | } else if ((mods | osm) & MOD_MASK_SHIFT) { | ||
| 234 | // Partial screenshot | ||
| 235 | tap_code16(LGUI(LSFT(KC_S))); | ||
| 236 | return false; | ||
| 237 | } else { | ||
| 238 | // Full screenshot | ||
| 239 | // PrintScreen should work as is | ||
| 240 | } | ||
| 241 | break; | ||
| 242 | |||
| 243 | default: | ||
| 244 | // Note: These are specific to ChromeOS | ||
| 245 | if ((mods | osm) & MOD_MASK_ALT) { | ||
| 246 | // Window screenshot | ||
| 247 | tap_code16(LCTL(LALT(KC_F5))); | ||
| 248 | return false; | ||
| 249 | } else if ((mods | osm) & MOD_MASK_SHIFT) { | ||
| 250 | // Partial screenshot | ||
| 251 | tap_code16(LCTL(LSFT(KC_F5))); | ||
| 252 | return false; | ||
| 253 | } else { | ||
| 254 | // Full screenshot | ||
| 255 | // PrintScreen should work as is | ||
| 256 | } | ||
| 257 | break; | ||
| 258 | } | ||
| 259 | break; | ||
| 260 | } | ||
| 195 | } | 261 | } |
| 196 | } else { | 262 | } else { |
| 197 | switch (keycode) { | 263 | switch (keycode) { |
