summaryrefslogtreecommitdiff
path: root/keyboards/ps2avrGB
diff options
context:
space:
mode:
authorLuiz Ribeiro <luizribeiro@gmail.com>2017-07-04 11:12:42 -0400
committerLuiz Ribeiro <luizribeiro@gmail.com>2017-07-04 11:12:42 -0400
commit738b072bb0f25d0369a998c550c369e4f64cc7a5 (patch)
tree988b8a3cdb455b908d69f0f4ab34fb30261ab972 /keyboards/ps2avrGB
parent60153e7bbc51e62c329cd55ea026340940c88104 (diff)
Fixed indentation and now using quantum keycodes for rgblight
Diffstat (limited to 'keyboards/ps2avrGB')
-rw-r--r--keyboards/ps2avrGB/keymaps/default/keymap.c89
-rwxr-xr-xkeyboards/ps2avrGB/program2
-rw-r--r--keyboards/ps2avrGB/ps2avrGB.h1
3 files changed, 19 insertions, 73 deletions
diff --git a/keyboards/ps2avrGB/keymaps/default/keymap.c b/keyboards/ps2avrGB/keymaps/default/keymap.c
index 60929ac997..4650ff633f 100644
--- a/keyboards/ps2avrGB/keymaps/default/keymap.c
+++ b/keyboards/ps2avrGB/keymaps/default/keymap.c
@@ -20,79 +20,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "rgblight.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- KC_KEYMAP(
- ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END,
- GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL,
- TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS,
- CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,
- LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,
- LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT
- )
-};
-
-enum function_id {
- RGBLED_TOGGLE,
- RGBLED_STEP_MODE,
- RGBLED_INCREASE_HUE,
- RGBLED_DECREASE_HUE,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S,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,
+ KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,
+ KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_RGHT
+ ),
};
const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_FUNCTION(RGBLED_TOGGLE),
- [1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
- [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
- [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
- [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
- [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
- [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
- [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
-};
-
-void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
- switch (id) {
- case RGBLED_TOGGLE:
- if (record->event.pressed) {
- rgblight_toggle();
- }
- break;
- case RGBLED_STEP_MODE:
- if (record->event.pressed) {
- rgblight_step();
- }
- break;
- case RGBLED_INCREASE_HUE:
- if (record->event.pressed) {
- rgblight_increase_hue();
- }
- break;
- case RGBLED_DECREASE_HUE:
- if (record->event.pressed) {
- rgblight_decrease_hue();
- }
- break;
- case RGBLED_INCREASE_SAT:
- if (record->event.pressed) {
- rgblight_increase_sat();
- }
- break;
- case RGBLED_DECREASE_SAT:
- if (record->event.pressed) {
- rgblight_decrease_sat();
- }
- break;
- case RGBLED_INCREASE_VAL:
- if (record->event.pressed) {
- rgblight_increase_val();
- }
- break;
- case RGBLED_DECREASE_VAL:
- if (record->event.pressed) {
- rgblight_decrease_val();
- }
- break;
- }
+ [0] = ACTION_LAYER_MOMENTARY(1),
};
diff --git a/keyboards/ps2avrGB/program b/keyboards/ps2avrGB/program
index b45bff8e5f..a88d9cd9b0 100755
--- a/keyboards/ps2avrGB/program
+++ b/keyboards/ps2avrGB/program
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
diff --git a/keyboards/ps2avrGB/ps2avrGB.h b/keyboards/ps2avrGB/ps2avrGB.h
index 813f31f804..35902cff4d 100644
--- a/keyboards/ps2avrGB/ps2avrGB.h
+++ b/keyboards/ps2avrGB/ps2avrGB.h
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
+#include "quantum_keycodes.h"
#include "keycode.h"
#include "action.h"