From deea6a98267e3b9bf793d9a64bfd586a07ef5c48 Mon Sep 17 00:00:00 2001 From: Takeshi Nishio Date: Mon, 25 Jan 2021 06:54:29 +0900 Subject: [PATCH] Add jones v.0.3 and v.0.3.1 keyboard (#11130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update LEDの物理的接続とQMKのソフト的接続を調整し、左→アンダーグロー→右と繋がるようにした。 * Update レイヤーインジケータ関連変数を、#ifdefブロック内へ移動。 * Update コード整形 * Revert "Update コード整形" This reverts commit c98483d9a0b41f8939a01b677cdcd18a8af34f78. * Update 未使用のキーコード、S_SLSHに関連するコードを削除。 * Update コード整形 * Update キーごとのTappingTerm設定を使用しなくなったため、削除。 * Update 未使用コード削除。 * Update コメント追加 * Update レイヤーとIMEのON/OFFを同じキーに割り当てるのをやめたため、関連コードを削除。 * Update コメント追加 * Update コメント * Update 誤読を避けるため、ifブロックの表記を括弧を使用したものへ変更。動作に変化なし。 * Update 未使用のため削除。 * Update LED関連でデフォルトレイヤーを格納して使用しないため、削除。 * Update コメント * Update レイヤーによってロータリーエンコーダの動作を変える機能を追加。 * Update comment * Update 実態に合わせて修正。 * Update JP用キーコードへの書き換え忘れを修正。 * New v.0.3.1 JP style * Update v.0.3のJPスタイルではオーディオサポートなし。 * Update to latest information * New * New keyboard "stmeishi" * Update layout name * Update move common settings from keymap's "rules.mk" to keyboard's "rules.mk". * Update: Move common settings from keymap's "rules.mk" to keyboard's "rules.mk". * Update: Add "LAYOUT_all" for multiple layout. * Update target to latest "v.0.3.1". * Remove unused item. * Update comments. * Update Rotary Encoder pins to actual used count. * Update increase value to maximum. * Update comments. * Change default Effects. * Remove unused items. * Update comment. * Change: Use define and function insted of real value for wait. * Update copyrght. * Update Update: Add "LAYOUT_all" for multiple layout. * New: Place info.json copied from v.0.3.1. * Remove unused items. * Update: Add comma at last element. * Update comments. * Update: change if block style. * Update: Change Japanese comments to English. * Update: Change layout name. * Update: Change layout name. * Update: Fix miss numbering for ANSI layout. * Update: Move "Tap Dance" rule to keymap's rule. * New: Add default keymap. * Delete: Moving files to branch. * Initial: Add files from local. * Remove local only unused keymaps. * Update: Remove unused, comment outed codes. * Add default keymap for v.0.3. * Update: Add custom keycodes. * Update: Change layer handling from process_record_user to layer_state_set_user. * Update comment. * Update: Remove unused function. * Add my ErgoDash settings. * Add my NumAtreus_Plus8 settings. * Add my test_k15r2 settings. * New Colice片手分動作確認済み * Update スプリットキーボード対応 * Update 反応が悪くずっと二度押ししているので、ESCキーをレイヤーキーとの共用から、単独機能に変更。 * Update 右手スイッチ配置変更。インジケータLED対応。 * Change インジケータLEDが眩しいので、明るさを下げた。 * Change 右手親指のキーマップ変更。 * Change NumLockの誤爆防止のため、二度押しでレイヤートグルするようにした。 * Change 左手側、Bの右側のキーを誤爆することが多く日本語入力が途切れるため、レイヤーキーの機能左右で入れ替え。 * Update 右手側、画像ソフトなどで使うため、矢印キーの左をレイヤーキーからCTRLへ変更。 * New add new keyboard * Update Duplex-Matrixが動作した初版 * New Duplex-Matrixのサンプルコード by e3w2q を最新のQMKファームウェアで動作するよう一部修正したもの。 * update Comment-out debug print code. * Update Colice V0.2 キープレートで矢印キー付近の物理配列が変わったことへ対応 * Update キーレイアウト * New Initial commit * Update Fix migrate errors from test_duplex_dp to test_col2col * Remove unnecessary files * Testing * Update IKeJIさんの方法(とりあえずCOL2COLと呼ぶ)の動作テストOK * New 2乗マトリクス配線のキーボードを追加 * Update キーレイアウト調整 * New colice_rr 初回コミット。基本動作確認OK。LED不調。 * Update Eable LED, Reduce firmwre size * Update colice_rr キーマップ調整。 * Update colice_rr ロータリーエンコーダ機能追加。 * Move colice_rr を colice_rr_split へ移動。 * Update colice_rr_splitフォルダへ移動したことに対応。 * New colice_rr_splitの初回コミット。 * Update キーマップ調整 * Update キーマップ調整 * New initial comit * Update 意図せずカッコを入力することがるため、LSPO、RSPCの使用を中止。 * Change Fnキー押下時の日本語入力ONを、長押し時にキャンセルするように変更。 * Change LED点灯方法変更。 * Change 基板バージョンごとにサブフォルダを作成するようにした。 * Update Windows用レイヤーを追加 * Update LED設定を調整 * New Jones v.0.2を新規追加 * Update Numレイヤー追加。キーマップ調整。レイヤーインジケータLED調整。 * Update 左手Yをやめる * Update ESCによるNumレイヤートグルを、ESC連打でトグルするのを防止するため、ダブルタップからトリプルタップへ変更。 * Update readme * Update QMKの標準に従うよう各ファイルの内容を変更。 * Update 長音(ー)を入力しやすくするため、レイヤー上でホームポジションに近い位置に配置。 * Update タップダンスの状態判別を、Single,Double,Triple,Holdの4つのステータスにまとめた。 * Update キーボードの電源が切れてもデフォルトレイヤーの状態を保存しておくため、MACとWINレイヤーへの変更はEEPROMへ書き込むようにした。 * Update 不要箇所削除 * Update キーマップをNarrowとWideで書き換えるのが不便なので、分割した。 * Update 最新のPCBに合わせ、デフォルトをv.0.2に変更。 * New v.0.3を新規追加 * Update キーマトリクスに後からJPを追加するため、ANSI用に表記変更。 * Update ANSI用のキーマップであることを明記。 * New JP用キーマップを新規追加。 * Update スイッチの物理的存在、Enter右側はキー1個、に合わせて、ANSIレイアウトを修正。 * New FA (Full Armor)用レイアウトを新規追加 * Update 物理的ロック付きのCAPSは使用しないため、無効化。 * Update ハードウェアのサポート対象にキープレートを追加。 * Update FAで使用するAudio、RotaryEncoderの機能追加。機能削減でファームウェアサイズ縮小。 * Update オーディオ機能にキークリックを追加。 * update FA用設定 * Update 右シフトにキー追加 * Update 変換キー調整 * New オーディを有効化。マウスキーはサイズ削減のため無効化。 * Update スイッチ配置ミス修正。 * Update ピン定義を、ロータリーエンコーダの回転方向に合わせた * Update 2音同時発音用にピン定義を追加。 * Update ファームサイズに空きがあるので、クリッキー音をデフォルトで利用できるようにした。 * Update LED設定変更 * New 物理配列がJPで、中身はUS配列のキーマップを追加。 * Update 行と列が入り乱れたレイアウトのため、音階が正しくなるように、Music-Mode用のキーマップを定義。 * Change マイナーバージョンの表記に対応できるよう、DEVICE_VERの桁を1つ上げた。 * Update オルソ+ロースタガであることがわかるように、キーボードの簡単な説明を変更。 * New v.0.3.1の初期コミット * Update 左右で回転方向の判定が逆になるので、右手側を左手に合わせた。 * Update キーマップ調整 * Update LEDインジケータを、v.0.3系と同じ点灯方法(2個をベースレイヤ、1個をRAISEなど)に変更。 * Update RGBLIGHT明るさ調整、エフェクト追加。 * Update 未使用キー設定を削除。 * Update Shiftと組み合わせた/?キーの反応を良くするため、キーごとにTAPPING_TERMを指定できるようにした。 * Update LEDエフェクト追加 * Update keymap * Update 未使用のものを削除 * Update LEDの物理的接続とQMKのソフト的接続を調整し、左→アンダーグロー→右と繋がるようにした。 * Update レイヤーインジケータ関連変数を、#ifdefブロック内へ移動。 * Update コード整形 * Revert "Update コード整形" This reverts commit c98483d9a0b41f8939a01b677cdcd18a8af34f78. * Update 未使用のキーコード、S_SLSHに関連するコードを削除。 * Update コード整形 * Update キーごとのTappingTerm設定を使用しなくなったため、削除。 * Update 未使用コード削除。 * Update コメント追加 * Update レイヤーとIMEのON/OFFを同じキーに割り当てるのをやめたため、関連コードを削除。 * Update コメント追加 * Update コメント * Update 誤読を避けるため、ifブロックの表記を括弧を使用したものへ変更。動作に変化なし。 * Update 未使用のため削除。 * Update LED関連でデフォルトレイヤーを格納して使用しないため、削除。 * Update コメント * Update レイヤーによってロータリーエンコーダの動作を変える機能を追加。 * Update comment * Update 実態に合わせて修正。 * Update JP用キーコードへの書き換え忘れを修正。 * New v.0.3.1 JP style * Update v.0.3のJPスタイルではオーディオサポートなし。 * Update to latest information * New * New keyboard "stmeishi" * Update layout name * Update move common settings from keymap's "rules.mk" to keyboard's "rules.mk". * Update: Move common settings from keymap's "rules.mk" to keyboard's "rules.mk". * Update: Add "LAYOUT_all" for multiple layout. * Update target to latest "v.0.3.1". * Remove unused item. * Update comments. * Update Rotary Encoder pins to actual used count. * Update increase value to maximum. * Update comments. * Change default Effects. * Remove unused items. * Update comment. * Change: Use define and function insted of real value for wait. * Update copyrght. * Update Update: Add "LAYOUT_all" for multiple layout. * New: Place info.json copied from v.0.3.1. * Remove unused items. * Update: Add comma at last element. * Update comments. * Update: change if block style. * Update: Change Japanese comments to English. * Update: Change layout name. * Update: Change layout name. * Update: Fix miss numbering for ANSI layout. * Update: Move "Tap Dance" rule to keymap's rule. * New: Add default keymap. * Delete: Moving files to branch. * Initial: Add files from local. * Remove local only unused keymaps. * Update: Remove unused, comment outed codes. * Add default keymap for v.0.3. * Update: Add custom keycodes. * Update: Change layer handling from process_record_user to layer_state_set_user. * Update comment. * Update: Remove unused function. * Revert "Remove: Non related files." This reverts commit 82306568fad408427c757de832025dee91ca5a7f. * Update: To resolve "submodule path not found" message. * RemoRemove: Non related files. * Revert file before miss comit. * Update: Remove unused keycode. * Update: レイアウト設定内のNUMレイヤへのトグルを、カスタムキーコード表記に変更。 * Update: Comment * Update: Remove unused items. * Update layout settings. * Update: For simplicity, change toggle ADJUST layer method from process_record_user() to layer_state_set_user(). * Update: comment and styling. * Update: Remove unused custom keycodes. * Update: For simplicity, change toggle layer method from process_record_user() to layer_state_set_user(). * Update: Remove unused items. * Update: comment and styling. * Update: Correct comment. * Update description and flashing example. * Update: Remove comment-outed bootloaders. * Update comments. * Update: Correct LED count, without under-glow. * Update: Chenged to common values with v.0.3.1. * Update: Changed to common values with v.0.3. * Updarte: Remove unused layout. * Update: Change default layout to "ALL". * Update comment. * Update comment. * Add missing file. * Update: Change build option definition style. * Update: Change build option definition style. * Update: Change CUSTOM_MATRIX to "lite" and convert "matrix.c" to "lite" version. * Update: Move "music_map" to keyboard's c file. To provide common definition for other keymap creator. * Update: Change keyboard name "v.0.3.1" ---> "v03_1". For human readability, version name "v.0.3.1" remains at title on "readme.md". * Update: Change keyboard name "v.0.3" ---> "v03". For human readability, version name "v.0.3" remains at title on "readme.md". * Update: Correct matrix definition at "k92". * Apply suggestions from code review Remove unnecessary comment block. * Apply suggestions from code review Remove "Optional" deprecated items. * Apply suggestions from code review Change "make" target keymap to standard default. * Apply suggestions from code review Remove rules for MIDI_ENABLE, FAUXCLICKY_ENABLE and HD44780_ENABLE. These features are not enabled. * Apply suggestions from code review Convert tabs to spaces. * Update: Change #define ROW_SHIFTER to keyboard specific. --- keyboards/jones/readme.md | 24 ++ keyboards/jones/rules.mk | 1 + keyboards/jones/v03/config.h | 165 ++++++++ keyboards/jones/v03/info.json | 35 ++ keyboards/jones/v03/keymaps/default/keymap.c | 27 ++ keyboards/jones/v03/keymaps/default/readme.md | 1 + .../jones/v03/keymaps/default_jp/config.h | 23 ++ .../jones/v03/keymaps/default_jp/keymap.c | 343 +++++++++++++++++ .../jones/v03/keymaps/default_jp/readme.md | 1 + .../jones/v03/keymaps/default_jp/rules.mk | 1 + keyboards/jones/v03/matrix.c | 99 +++++ keyboards/jones/v03/readme.md | 24 ++ keyboards/jones/v03/rules.mk | 29 ++ keyboards/jones/v03/v03.c | 17 + keyboards/jones/v03/v03.h | 105 +++++ keyboards/jones/v03_1/config.h | 166 ++++++++ keyboards/jones/v03_1/info.json | 35 ++ .../jones/v03_1/keymaps/default/keymap.c | 26 ++ .../jones/v03_1/keymaps/default/readme.md | 1 + .../jones/v03_1/keymaps/default_ansi/config.h | 26 ++ .../jones/v03_1/keymaps/default_ansi/keymap.c | 362 +++++++++++++++++ .../v03_1/keymaps/default_ansi/readme.md | 1 + .../jones/v03_1/keymaps/default_ansi/rules.mk | 1 + .../jones/v03_1/keymaps/default_jp/config.h | 26 ++ .../jones/v03_1/keymaps/default_jp/keymap.c | 364 ++++++++++++++++++ .../jones/v03_1/keymaps/default_jp/readme.md | 1 + .../jones/v03_1/keymaps/default_jp/rules.mk | 1 + keyboards/jones/v03_1/matrix.c | 99 +++++ keyboards/jones/v03_1/readme.md | 24 ++ keyboards/jones/v03_1/rules.mk | 29 ++ keyboards/jones/v03_1/v03_1.c | 27 ++ keyboards/jones/v03_1/v03_1.h | 105 +++++ 32 files changed, 2189 insertions(+) create mode 100644 keyboards/jones/readme.md create mode 100644 keyboards/jones/rules.mk create mode 100644 keyboards/jones/v03/config.h create mode 100644 keyboards/jones/v03/info.json create mode 100644 keyboards/jones/v03/keymaps/default/keymap.c create mode 100644 keyboards/jones/v03/keymaps/default/readme.md create mode 100644 keyboards/jones/v03/keymaps/default_jp/config.h create mode 100644 keyboards/jones/v03/keymaps/default_jp/keymap.c create mode 100644 keyboards/jones/v03/keymaps/default_jp/readme.md create mode 100644 keyboards/jones/v03/keymaps/default_jp/rules.mk create mode 100644 keyboards/jones/v03/matrix.c create mode 100644 keyboards/jones/v03/readme.md create mode 100644 keyboards/jones/v03/rules.mk create mode 100644 keyboards/jones/v03/v03.c create mode 100644 keyboards/jones/v03/v03.h create mode 100644 keyboards/jones/v03_1/config.h create mode 100644 keyboards/jones/v03_1/info.json create mode 100644 keyboards/jones/v03_1/keymaps/default/keymap.c create mode 100644 keyboards/jones/v03_1/keymaps/default/readme.md create mode 100644 keyboards/jones/v03_1/keymaps/default_ansi/config.h create mode 100644 keyboards/jones/v03_1/keymaps/default_ansi/keymap.c create mode 100644 keyboards/jones/v03_1/keymaps/default_ansi/readme.md create mode 100644 keyboards/jones/v03_1/keymaps/default_ansi/rules.mk create mode 100644 keyboards/jones/v03_1/keymaps/default_jp/config.h create mode 100644 keyboards/jones/v03_1/keymaps/default_jp/keymap.c create mode 100644 keyboards/jones/v03_1/keymaps/default_jp/readme.md create mode 100644 keyboards/jones/v03_1/keymaps/default_jp/rules.mk create mode 100644 keyboards/jones/v03_1/matrix.c create mode 100644 keyboards/jones/v03_1/readme.md create mode 100644 keyboards/jones/v03_1/rules.mk create mode 100644 keyboards/jones/v03_1/v03_1.c create mode 100644 keyboards/jones/v03_1/v03_1.h diff --git a/keyboards/jones/readme.md b/keyboards/jones/readme.md new file mode 100644 index 00000000000..180c12e18a8 --- /dev/null +++ b/keyboards/jones/readme.md @@ -0,0 +1,24 @@ +# Jones + +![Jones, ANSI style](https://github.com/jpskenn/Jones/raw/master/assets/IMG_2204.jpeg) + +![Jones, JP style](https://github.com/jpskenn/Jones/raw/master/assets/DSC_7189.jpeg) + +A 60% keyboard combined with Ortho-Linear and Row-staggered. It has gapless R2-R3 row. +GH60 case compatible PCB and keyplate. + +* Keyboard Maintainer: [jpskenn](https://github.com/jpskenn) +* Hardware Supported: Jones PCB, Keyplate +* Hardware Availability: [GitHub](https://github.com/jpskenn/Jones), [BOOTH](https://jpskenn.booth.pm) + +Make example for this keyboard (after setting up your build environment): + + make jones/v03_1:default_ansi + +Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): + + make jones/v03_1:default_ansi:flash + +To reset the keyboard into bootloader mode, press the reset switch on the underside. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/jones/rules.mk b/keyboards/jones/rules.mk new file mode 100644 index 00000000000..6b494303573 --- /dev/null +++ b/keyboards/jones/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = jones/v03_1 diff --git a/keyboards/jones/v03/config.h b/keyboards/jones/v03/config.h new file mode 100644 index 00000000000..3683a43dd19 --- /dev/null +++ b/keyboards/jones/v03/config.h @@ -0,0 +1,165 @@ +/* +Copyright 2020 Takeshi Nishio + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x175A +#define DEVICE_VER 0x0030 +#define MANUFACTURER jpskenn +#define PRODUCT Jones + +/* key matrix size */ +// Same size for Jones' custom Round-Robin matrix. +#define MATRIX_ROWS 11 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +// Same pins for Jones' custom Round-Robin matrix. +#define MATRIX_ROW_PINS { D4, D7, C7, F1, F4, F5, D6, D5, E6, B0, B1 } +#define MATRIX_COL_PINS { D4, D7, C7, F1, F4, F5, D6, D5, E6, B0, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +// No need to define DIODE_DIRECTION for Jones' custom Round-Robin matrix. +//#define DIODE_DIRECTION COL2ROW + +/* Rotary Encoder */ +#define ENCODERS_PAD_A { F6, B3 } +#define ENCODERS_PAD_B { F7, B2 } +#define ENCODER_RESOLUTION 4 //the default & suggested is 4 + +/* Audio */ +#ifdef AUDIO_ENABLE + #define C6_AUDIO + #define B6_AUDIO // 2nd pin for simultaneous audio. + #define AUDIO_CLICKY +#endif + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN B7 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 6 // Left(4) + Right(2) + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + /*== Lighting Layers ==*/ + #define RGBLIGHT_LAYERS + // #define RGBLIGHT_MAX_LAYERS 2 + #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF // Overriding RGB Lighting on/off status + /*== all animations enable ==*/ + // #define RGBLIGHT_ANIMATIONS + /*== or choose animations ==*/ + // #define RGBLIGHT_EFFECT_BREATHING + // #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + // #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + // #define RGBLIGHT_EFFECT_CHRISTMAS + // #define RGBLIGHT_EFFECT_STATIC_GRADIENT + // #define RGBLIGHT_EFFECT_RGB_TEST + // #define RGBLIGHT_EFFECT_ALTERNATING + // /*== customize breathing effect ==*/ + // /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ + // #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 + // /*==== use exp() and sin() ====*/ + // #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 + // #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +// #define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +// #define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/jones/v03/info.json b/keyboards/jones/v03/info.json new file mode 100644 index 00000000000..eaee5a6916b --- /dev/null +++ b/keyboards/jones/v03/info.json @@ -0,0 +1,35 @@ +{ + "keyboard_name": "Jones", + "url": "https://github.com/jpskenn/Jones", + "maintainer": "jpskenn", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"", "x":7, "y":0}, {"label":"", "x":8, "y":0}, {"label":"", "x":9, "y":0}, {"label":"", "x":10, "y":0}, {"label":"", "x":11, "y":0}, {"label":"", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"Backspace", "x":11.5, "y":1, "w":1.5}, {"label":"{", "x":13, "y":1}, {"label":"}", "x":14, "y":1}, + {"label":"Ctrl", "x":0.25, "y":2, "w":1.25}, {"label":"A", "x":1.5, "y":2}, {"label":"S", "x":2.5, "y":2}, {"label":"D", "x":3.5, "y":2}, {"label":"F", "x":4.5, "y":2}, {"label":"G", "x":5.5, "y":2}, {"label":"H", "x":6.5, "y":2}, {"label":"J", "x":7.5, "y":2}, {"label":"K", "x":8.5, "y":2}, {"label":"L", "x":9.5, "y":2}, {"label":":", "x":10.5, "y":2}, {"label":"Enter", "x":11.5, "y":2, "w":2.25}, {"label":"\u201d", "x":13.75, "y":2}, + {"label":"Shift", "x":0.25, "y":3, "w":1.75}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"Fn", "x":14, "y":3}, + {"label":"Rotary", "x":0, "y":4}, {"label":"Caps", "x":1, "y":4}, {"label":"Opt", "x":2, "y":4, "w":1.25}, {"label":"Cmd", "x":3.25, "y":4, "w":1.25}, {"label":"Space & Shift", "x":4.5, "y":4, "w":2}, {"label":"Space & Raise", "x":6.5, "y":4, "w":2}, {"label":"Cmd", "x":8.5, "y":4, "w":1.25}, {"label":"Opt", "x":9.75, "y":4, "w":1.25}, {"label":"Ctrl", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4} + ] + }, + "LAYOUT_jp": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"&", "x":6, "y":0}, {"label":"'", "x":7, "y":0}, {"label":"(", "x":8, "y":0}, {"label":")", "x":9, "y":0}, {"label":"", "x":10, "y":0}, {"label":"=", "x":11, "y":0}, {"label":"BS", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"|", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"Enter", "x":11.5, "y":1, "w":1.25, "h":2, "r":180, "rx":12.125, "ry":1.5}, {"label":"`", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, + {"label":"Ctrl", "x":0.25, "y":2, "w":1.25}, {"label":"A", "x":1.5, "y":2}, {"label":"S", "x":2.5, "y":2}, {"label":"D", "x":3.5, "y":2}, {"label":"F", "x":4.5, "y":2}, {"label":"G", "x":5.5, "y":2}, {"label":"H", "x":6.5, "y":2}, {"label":"J", "x":7.5, "y":2}, {"label":"K", "x":8.5, "y":2}, {"label":"L", "x":9.5, "y":2}, {"label":"+", "x":10.5, "y":2}, {"label":"*", "x":13, "y":2}, {"label":"}", "x":14, "y":2}, + {"label":"Shift", "x":0.25, "y":3, "w":1.75}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"_", "x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"", "x":14, "y":3}, + {"label":"Rotary", "x":0, "y":4}, {"label":"\u7530", "x":1, "y":4}, {"label":"Alt", "x":2, "y":4, "w":1.25}, {"label":"\u7121\u5909\u63db", "x":3.25, "y":4}, {"label":"Space", "x":4.25, "y":4, "w":2.25}, {"label":"Space", "x":6.5, "y":4, "w":2}, {"label":"\u5909\u63db", "x":8.5, "y":4, "w":1.25}, {"label":"\u30ab\u30ca", "x":9.75, "y":4, "w":1.25}, {"label":"\u76ee", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] + }, + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"", "x":7, "y":0}, {"label":"", "x":8, "y":0}, {"label":"", "x":9, "y":0}, {"label":"", "x":10, "y":0}, {"label":"", "x":11, "y":0}, {"label":"", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"Backspace", "x":11.5, "y":1, "w":1.5}, {"label":"{", "x":13, "y":1}, {"label":"}", "x":14, "y":1}, + {"label":"Ctrl", "x":0.25, "y":2, "w":1.25}, {"label":"A", "x":1.5, "y":2}, {"label":"S", "x":2.5, "y":2}, {"label":"D", "x":3.5, "y":2}, {"label":"F", "x":4.5, "y":2}, {"label":"G", "x":5.5, "y":2}, {"label":"H", "x":6.5, "y":2}, {"label":"J", "x":7.5, "y":2}, {"label":"K", "x":8.5, "y":2}, {"label":"L", "x":9.5, "y":2}, {"label":":", "x":10.5, "y":2}, {"label":"Enter", "x":11.5, "y":2, "w":1.5}, {"label":"\u201d", "x":13, "y":2}, {"label":"\u201d", "x":14, "y":2}, + {"label":"Shift", "x":0.25, "y":3, "w":1.75}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"Fn", "x":14, "y":3}, + {"label":"Rotary", "x":0, "y":4}, {"label":"Caps", "x":1, "y":4}, {"label":"Opt", "x":2, "y":4, "w":1.25}, {"label":"Cmd", "x":3.25, "y":4, "w":1.25}, {"label":"Space & Shift", "x":4.5, "y":4, "w":2}, {"label":"Space & Raise", "x":6.5, "y":4, "w":2}, {"label":"Cmd", "x":8.5, "y":4, "w":1.25}, {"label":"Opt", "x":9.75, "y":4, "w":1.25}, {"label":"Ctrl", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4} + ] + } + } +} diff --git a/keyboards/jones/v03/keymaps/default/keymap.c b/keyboards/jones/v03/keymaps/default/keymap.c new file mode 100644 index 00000000000..05545c53738 --- /dev/null +++ b/keyboards/jones/v03/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, JP_MINS,KC_BSPC,JP_CIRC,JP_YEN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, XXXXXXX, JP_AT, JP_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_SCLN, KC_ENT, JP_COLN,JP_RBRC, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM,JP_DOT, JP_SLSH,JP_BSLS,KC_UP, XXXXXXX, + KC_MUTE,KC_LALT,KC_LGUI,KC_LANG2, KC_SPC, KC_SPC, KC_LANG1,KC_RGUI,KC_RALT,KC_LEFT,KC_DOWN,KC_RGHT + ) +}; \ No newline at end of file diff --git a/keyboards/jones/v03/keymaps/default/readme.md b/keyboards/jones/v03/keymaps/default/readme.md new file mode 100644 index 00000000000..a23bc4c15a0 --- /dev/null +++ b/keyboards/jones/v03/keymaps/default/readme.md @@ -0,0 +1 @@ +# Defalut keymap for Jones diff --git a/keyboards/jones/v03/keymaps/default_jp/config.h b/keyboards/jones/v03/keymaps/default_jp/config.h new file mode 100644 index 00000000000..aa06121c1c7 --- /dev/null +++ b/keyboards/jones/v03/keymaps/default_jp/config.h @@ -0,0 +1,23 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// double tap to toggle +#define TAPPING_TOGGLE 2 + +// time for long press +#define TAPPING_TERM 200 diff --git a/keyboards/jones/v03/keymaps/default_jp/keymap.c b/keyboards/jones/v03/keymaps/default_jp/keymap.c new file mode 100644 index 00000000000..d1a2a7abfdd --- /dev/null +++ b/keyboards/jones/v03/keymaps/default_jp/keymap.c @@ -0,0 +1,343 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +// Defines names for use in layer keycodes and the keymap +enum layer_number { + _MAC = 0, + _WIN, + _NUM, + _LOWER, + _RAISE, + _NUM_RAISE, + _ADJUST +}; + +// Tap Dance +enum tap_dances{ + TD_LSFT_CAPS = 0, + TD_ESC_NUM, +}; + +// Tap Dance state +enum { + SINGLE_TAP = 1, + DOUBLE_TAP, + TRIPLE_TAP, + TAP_HOLD, +}; + +// Declare the functions to be used with your tap dance key(s) +// Function associated with all tap dances +uint8_t cur_dance(qk_tap_dance_state_t *state); +// Functions associated with individual tap dances +void ql_finished(qk_tap_dance_state_t *state, void *user_data); +void ql_reset(qk_tap_dance_state_t *state, void *user_data); + +// Tap Dance definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), + [TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ql_finished, ql_reset, 275), +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MAC = SAFE_RANGE, + WIN, +}; + +// Key Macro +#define ESC_NUM TD(TD_ESC_NUM) +#define S_CAP TD(TD_LSFT_CAPS) +#define SP_RAI LT(_RAISE, KC_SPC) +#define SP_NRAI LT(_NUM_RAISE, KC_SPC) +#define SP_SFT MT(MOD_LSFT, KC_SPC) +#define S_BSLS RSFT_T(JP_BSLS) +#define C_SLSH RCTL_T(JP_SLSH) +#define CT_E LCTL(KC_E) +#define CT_A LCTL(KC_A) +#define ALT_GRV LALT(KC_GRV) +#define LOWER MO(_LOWER) +#define NUM TG(_NUM) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAC] = LAYOUT_jp( + ESC_NUM,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, JP_MINS,KC_BSPC,JP_CIRC,JP_YEN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_SCLN, KC_ENT, JP_COLN,JP_RBRC, + S_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM,JP_DOT, C_SLSH, S_BSLS, KC_UP, LOWER, + KC_MUTE,KC_LALT,KC_LGUI,KC_LANG2, SP_SFT, SP_RAI, KC_LANG1,KC_RGUI,KC_RALT,KC_LEFT,KC_DOWN,KC_RGHT + ), + [_WIN] = LAYOUT_jp( + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,KC_LGUI,KC_LALT,JP_MHEN, _______, _______, JP_HENK,JP_KANA,KC_APP, _______,_______,_______ + ), + [_NUM] = LAYOUT_jp( + _______,_______,_______,_______,_______,_______,_______,XXXXXXX,KC_PSLS,KC_PSLS,KC_PAST,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PPLS, _______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, XXXXXXX,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PENT,_______,_______,_______, + _______,_______,_______,_______, _______, SP_NRAI, KC_P0, KC_PDOT,_______,_______,_______,_______ + ), + [_LOWER] = LAYOUT_jp( + KC_PAUS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_PSCR, _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME, KC_END, KC_VOLU, + _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_LEFT,KC_RGHT, _______,KC_VOLD, + _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PGDN,KC_DOWN,_______,KC_PGUP,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + [_RAISE] = LAYOUT_jp( + KC_PAUS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_PSCR, _______,_______,CT_E, _______,_______,_______,_______,_______,_______,KC_PGUP, _______,_______, + _______, CT_A, _______,KC_DEL, KC_RGHT,KC_ESC, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,_______,_______, _______,_______, + _______, _______,_______,_______,_______,KC_LEFT,KC_PGDN,KC_ENT, _______,KC_MRWD,KC_MFFD,_______,KC_PGUP,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + [_NUM_RAISE] = LAYOUT_jp( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, JP_MINS,KC_BSPC,JP_CIRC,JP_YEN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_SCLN, KC_ENT, JP_COLN,JP_RBRC, + S_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM,JP_DOT, C_SLSH, S_BSLS, KC_UP, _______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,_______,_______,_______ + ), + [_ADJUST] = LAYOUT_jp( + _______,RGB_HUI,RGB_SAI,RGB_VAI,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,WIN, _______,RESET, _______,RGB_HUI,RGB_SAI,RGB_VAI,_______,RGB_RMOD, _______,_______, + _______, _______,_______,_______,_______,_______,RGB_HUD,RGB_SAD,RGB_VAD,RGB_TOG,RGB_MOD,_______, _______,_______, + _______, _______,_______,_______,_______,_______,NUM, MAC, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,_______,_______,_______ + ) +}; + +#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP) +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_jp( + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MAC: // Change default ayer --> Write to EEPROM + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case WIN: // Change default ayer --> Write to EEPROM + if (record->event.pressed) { + set_single_persistent_default_layer(_WIN); + } + return false; + break; + default: + break; + } + return true; +} + +//------------------------------------------------------------------------------ +// RGB Light settings +#ifdef RGBLIGHT_LAYERS + +// for Default layer (= Base layer) +const rgblight_segment_t PROGMEM my_mac_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_WHITE} +); +const rgblight_segment_t PROGMEM my_win_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_BLUE} +); +const rgblight_segment_t PROGMEM my_num_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_YELLOW} +); + +// for temporal layer +const rgblight_segment_t PROGMEM my_caps_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_MAGENTA} +); + +const rgblight_segment_t PROGMEM my_lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_GREEN} +); + +const rgblight_segment_t PROGMEM my_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_CYAN} +); + +const rgblight_segment_t PROGMEM my_num_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_GOLD} +); + +const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_RED} +); + +// Define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_mac_layer, + my_win_layer, + my_num_layer, + my_caps_layer, + my_lower_layer, + my_raise_layer, + my_num_raise_layer, + my_adjust_layer +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +// Enabling and disabling lighting layers +layer_state_t layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + + rgblight_set_layer_state(2, layer_state_cmp(state, _NUM)); + rgblight_set_layer_state(4, layer_state_cmp(state, _LOWER)); + rgblight_set_layer_state(5, layer_state_cmp(state, _RAISE)); + rgblight_set_layer_state(6, layer_state_cmp(state, _NUM_RAISE)); + rgblight_set_layer_state(7, layer_state_cmp(state, _ADJUST)); + + return state; +} + +// Enabling and disabling lighting layers for default layer +layer_state_t default_layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(0, layer_state_cmp(state, _MAC)); + rgblight_set_layer_state(1, layer_state_cmp(state, _WIN)); + rgblight_set_layer_state(2, layer_state_cmp(state, _NUM)); + + return state; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(3, led_state.caps_lock); + return true; +} +#endif + + +//------------------------------------------------------------------------------ +// Rotary Encoder +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder, Right side */ + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + if (index == 1) { /* Second encoder, Left side */ + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } +} + + +//------------------------------------------------------------------------------ +// Tap Dance function + + +typedef struct { + bool is_press_action; + uint8_t state; +} tap; + +// Determine the current tap dance state +uint8_t cur_dance(qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (!state->pressed) { + return SINGLE_TAP; + } else { + return TAP_HOLD; + } + } else if (state->count == 2) { + if (!state->pressed) { + return DOUBLE_TAP; + } else { + return TAP_HOLD; + } + } else if (state->count == 3) { + if (!state->pressed) { + return TRIPLE_TAP; + } else { + return TAP_HOLD; + } + } else { + return 8; // Magic number. At some point this method will expand to work for more presses + } +} + +// Initialize tap structure associated with example tap dance key +static tap ql_tap_state = { + .is_press_action = true, + .state = 0 +}; + +// Functions that control what our tap dance key does +void ql_finished(qk_tap_dance_state_t *state, void *user_data) { + ql_tap_state.state = cur_dance(state); + switch(state->keycode) { + case TD(TD_ESC_NUM): // ESC key action + switch (ql_tap_state.state) { + case SINGLE_TAP: + case DOUBLE_TAP: + // ESC + tap_code(KC_ESC); + break; + case TAP_HOLD: + // temporal layer change + layer_on(_NUM); + break; + case TRIPLE_TAP: + // toggle layer + // Check to see if the layer is already set + if (layer_state_is(_NUM)) { + // If already set, then switch it off + layer_off(_NUM); + } else { + // If not already set, then switch the layer on + layer_on(_NUM); + } + break; + } + break; + } +} + +void ql_reset(qk_tap_dance_state_t *state, void *user_data) { + switch(state->keycode) { + case TD(TD_ESC_NUM): + // If the key was held down and now is released then switch off the layer + if (ql_tap_state.state == TAP_HOLD) { + layer_off(_NUM); + } + ql_tap_state.state = 0; + break; + } +} diff --git a/keyboards/jones/v03/keymaps/default_jp/readme.md b/keyboards/jones/v03/keymaps/default_jp/readme.md new file mode 100644 index 00000000000..a5d679aefdd --- /dev/null +++ b/keyboards/jones/v03/keymaps/default_jp/readme.md @@ -0,0 +1 @@ +# Default JP-style keymap for Jones diff --git a/keyboards/jones/v03/keymaps/default_jp/rules.mk b/keyboards/jones/v03/keymaps/default_jp/rules.mk new file mode 100644 index 00000000000..d371e96a070 --- /dev/null +++ b/keyboards/jones/v03/keymaps/default_jp/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes # Enable Tap Dance \ No newline at end of file diff --git a/keyboards/jones/v03/matrix.c b/keyboards/jones/v03/matrix.c new file mode 100644 index 00000000000..9f3e76f935d --- /dev/null +++ b/keyboards/jones/v03/matrix.c @@ -0,0 +1,99 @@ +/* +Copyright 2012-2020 Jun Wako, Jack Humbert, Yiancar, Takeshi Nishio + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "matrix.h" +#include "quantum.h" + +#define ROW_SHIFTER ((uint16_t)1) + +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +static void select_row(uint8_t row) { + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); +} + +static void unselect_row(uint8_t row) { + setPinInputHigh(row_pins[row]); +} + +static void unselect_rows(void) { + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static void init_pins(void) { + unselect_rows(); + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + matrix_io_delay(); + + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // skip reading when index equals (= pin itself) + if (col_index != current_row) { + // Check col pin pin_state + if (readPin(col_pins[col_index]) == 0) { + // Pin LO, set col bit + current_matrix[current_row] |= (ROW_SHIFTER << col_index); + } else { + // Pin HI, clear col bit + current_matrix[current_row] &= ~(ROW_SHIFTER << col_index); + } + } + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +void matrix_init_custom(void) { + // initialize key pins + init_pins(); + + matrix_init_quantum(); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + bool changed = false; + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(current_matrix, current_row); + } + + matrix_scan_quantum(); + return changed; +} diff --git a/keyboards/jones/v03/readme.md b/keyboards/jones/v03/readme.md new file mode 100644 index 00000000000..5edae3fb3ea --- /dev/null +++ b/keyboards/jones/v03/readme.md @@ -0,0 +1,24 @@ +# Jones v.0.3 + +![Jones, ANSI style](https://github.com/jpskenn/Jones/raw/master/assets/IMG_2204.jpeg) + +![Jones, JP style](https://github.com/jpskenn/Jones/raw/master/assets/DSC_7189.jpeg) + +A 60% keyboard combined with Ortho-Linear and Row-staggered. It has gapless R2-R3 row. +GH60 case compatible PCB and keyplate. + +* Keyboard Maintainer: [jpskenn](https://github.com/jpskenn) +* Hardware Supported: Jones PCB, Keyplate +* Hardware Availability: [GitHub](https://github.com/jpskenn/Jones), [BOOTH](https://jpskenn.booth.pm) + +Make example for this keyboard (after setting up your build environment): + + make jones/v03:default + +Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): + + make jones/v03:default:flash + +To reset the keyboard into bootloader mode, press the reset switch on the underside. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/jones/v03/rules.mk b/keyboards/jones/v03/rules.mk new file mode 100644 index 00000000000..2a33056c22c --- /dev/null +++ b/keyboards/jones/v03/rules.mk @@ -0,0 +1,29 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output + +ENCODER_ENABLE = yes # Rotary Encoder + +CUSTOM_MATRIX = lite # Custom matrix for "Round-Robin Matrix" +SRC += matrix.c + +LTO_ENABLE = yes diff --git a/keyboards/jones/v03/v03.c b/keyboards/jones/v03/v03.c new file mode 100644 index 00000000000..9bc63fe961b --- /dev/null +++ b/keyboards/jones/v03/v03.c @@ -0,0 +1,17 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "v03.h" diff --git a/keyboards/jones/v03/v03.h b/keyboards/jones/v03/v03.h new file mode 100644 index 00000000000..6584f6cbc2c --- /dev/null +++ b/keyboards/jones/v03/v03.h @@ -0,0 +1,105 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +/* +FULL 11x11 ROUND-ROBIN MATRIX for Reference +{ KC_NO, k21, k31, k41, k51, k61, k71, k81, k91, ka1, kb1 }, \ +{ k12, KC_NO, k32, k42, k52, k62, k72, k82, k92, ka2, kb2 }, \ +{ k13, k23, KC_NO, k43, k53, k63, k73, k83, k93, ka3, kb3 }, \ +{ k14, k24, k34, KC_NO, k54, k64, k74, k84, k94, ka4, kb4 }, \ +{ k15, k25, k35, k45, KC_NO, k65, k75, k85, k95, ka5, kb5 }, \ +{ k16, k26, k36, k46, k56, KC_NO, k76, k86, k96, ka6, kb6 }, \ +{ k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ +{ k18, k28, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ +{ k19, k29, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ +{ k1a, k2a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, kba }, \ +{ k1b, k2b, k3b, k4b, k5b, k6b, k7b, k8b, k9b, kab, KC_NO } \ +*/ + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + k17, k27, k37, k47, k57, k67, k76, k86, k96, ka6, kb6, k81, k91, ka1, kb1, \ + k18, k38, k48, k58, k68, k78, k87, k97, ka7, kb7, k82, K92, ka2, kb2, \ + k19, k39, k49, k59, k69, k79, k89, k98, ka8, kb8, k83, k93, ka3, kb3, \ + k1a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, ka9, kb9, k84, k94, ka4, kb4, \ + k1b, k2b, k3b, k4b, k6b, k8b, k9b, kab, k85, k95, ka5, kb5 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k81, k91, ka1, kb1 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k82, KC_NO, ka2, kb2 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k83, k93, ka3, kb3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k84, k94, ka4, kb4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k85, k95, ka5, kb5 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k76, k86, k96, ka6, kb6 }, \ + { k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ + { k18, KC_NO, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ + { k19, KC_NO, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ + { k1a, KC_NO, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, KC_NO }, \ + { k1b, k2b, k3b, k4b, KC_NO, k6b, KC_NO, k8b, k9b, kab, KC_NO } \ +} + +#define LAYOUT_ansi( \ + k17, k27, k37, k47, k57, k67, k76, k86, k96, ka6, kb6, k81, k91, ka1, kb1, \ + k18, k38, k48, k58, k68, k78, k87, k97, ka7, kb7, k82, k92, ka2, kb2, \ + k19, k39, k49, k59, k69, k79, k89, k98, ka8, kb8, k83, k93, kb3, \ + k1a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, ka9, kb9, k84, k94, ka4, kb4, \ + k1b, k2b, k3b, k4b, k6b, k8b, k9b, kab, k85, k95, ka5, kb5 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k81, k91, ka1, kb1 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k82, k92, ka2, kb2 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k83, k93, KC_NO, kb3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k84, k94, ka4, kb4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k85, k95, ka5, kb5 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k76, k86, k96, ka6, kb6 }, \ + { k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ + { k18, KC_NO, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ + { k19, KC_NO, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ + { k1a, KC_NO, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, KC_NO }, \ + { k1b, k2b, k3b, k4b, KC_NO, k6b, KC_NO, k8b, k9b, kab, KC_NO } \ +} + +#define LAYOUT_jp( \ + k17, k27, k37, k47, k57, k67, k76, k86, k96, ka6, kb6, k81, k91, ka1, kb1, \ + k18, k38, k48, k58, k68, k78, k87, k97, ka7, kb7, k82, ka2, kb2, \ + k19, k39, k49, k59, k69, k79, k89, k98, ka8, kb8, k83, k93, ka3, kb3, \ + k1a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, ka9, kb9, k84, k94, ka4, kb4, \ + k1b, k2b, k3b, k4b, k6b, k8b, k9b, kab, k85, k95, ka5, kb5 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k81, k91, ka1, kb1 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k82, KC_NO, ka2, kb2 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k83, k93, ka3, kb3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k84, k94, ka4, kb4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k85, k95, ka5, kb5 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k76, k86, k96, ka6, kb6 }, \ + { k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ + { k18, KC_NO, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ + { k19, KC_NO, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ + { k1a, KC_NO, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, KC_NO }, \ + { k1b, k2b, k3b, k4b, KC_NO, k6b, KC_NO, k8b, k9b, kab, KC_NO } \ +} diff --git a/keyboards/jones/v03_1/config.h b/keyboards/jones/v03_1/config.h new file mode 100644 index 00000000000..a064e563969 --- /dev/null +++ b/keyboards/jones/v03_1/config.h @@ -0,0 +1,166 @@ +/* +Copyright 2020 Takeshi Nishio + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x175A +#define DEVICE_VER 0x0031 +#define MANUFACTURER jpskenn +#define PRODUCT Jones + +/* key matrix size */ +// Same size for Jones' custom Round-Robin matrix. +#define MATRIX_ROWS 11 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +// Same pins for Jones' custom Round-Robin matrix. +#define MATRIX_ROW_PINS { D4, D7, C7, F1, F4, F5, D6, D5, E6, B0, B1 } +#define MATRIX_COL_PINS { D4, D7, C7, F1, F4, F5, D6, D5, E6, B0, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +// No need to define DIODE_DIRECTION for Jones' custom Round-Robin matrix. +//#define DIODE_DIRECTION COL2ROW + +/* Rotary Encoder */ +#define ENCODERS_PAD_A { F6, B3 } +#define ENCODERS_PAD_B { F7, B2 } +#define ENCODER_RESOLUTION 4 //the default & suggested is 4 + +/* Audio */ +#ifdef AUDIO_ENABLE + #define C6_AUDIO + #define B7_AUDIO // 2nd pin for simultaneous audio. + #define AUDIO_CLICKY +#endif + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 14 // Left(4) + Right(2) + Under(8) + #define RGBLIGHT_LED_MAP {0,1,2,3,13,12,4,5,6,7,8,9,10,11} // Left --> Right --> Under + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + /*== Lighting Layers ==*/ + #define RGBLIGHT_LAYERS + // #define RGBLIGHT_MAX_LAYERS 2 + #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF // Overriding RGB Lighting on/off status + /*== all animations enable ==*/ + // #define RGBLIGHT_ANIMATIONS + /*== or choose animations ==*/ + // #define RGBLIGHT_EFFECT_BREATHING + // #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + // #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + // #define RGBLIGHT_EFFECT_CHRISTMAS + // #define RGBLIGHT_EFFECT_STATIC_GRADIENT + // #define RGBLIGHT_EFFECT_RGB_TEST + // #define RGBLIGHT_EFFECT_ALTERNATING + // /*== customize breathing effect ==*/ + // /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ + // #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 + // /*==== use exp() and sin() ====*/ + // #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 + // #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +// #define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +// #define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/jones/v03_1/info.json b/keyboards/jones/v03_1/info.json new file mode 100644 index 00000000000..eaee5a6916b --- /dev/null +++ b/keyboards/jones/v03_1/info.json @@ -0,0 +1,35 @@ +{ + "keyboard_name": "Jones", + "url": "https://github.com/jpskenn/Jones", + "maintainer": "jpskenn", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"", "x":7, "y":0}, {"label":"", "x":8, "y":0}, {"label":"", "x":9, "y":0}, {"label":"", "x":10, "y":0}, {"label":"", "x":11, "y":0}, {"label":"", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"Backspace", "x":11.5, "y":1, "w":1.5}, {"label":"{", "x":13, "y":1}, {"label":"}", "x":14, "y":1}, + {"label":"Ctrl", "x":0.25, "y":2, "w":1.25}, {"label":"A", "x":1.5, "y":2}, {"label":"S", "x":2.5, "y":2}, {"label":"D", "x":3.5, "y":2}, {"label":"F", "x":4.5, "y":2}, {"label":"G", "x":5.5, "y":2}, {"label":"H", "x":6.5, "y":2}, {"label":"J", "x":7.5, "y":2}, {"label":"K", "x":8.5, "y":2}, {"label":"L", "x":9.5, "y":2}, {"label":":", "x":10.5, "y":2}, {"label":"Enter", "x":11.5, "y":2, "w":2.25}, {"label":"\u201d", "x":13.75, "y":2}, + {"label":"Shift", "x":0.25, "y":3, "w":1.75}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"Fn", "x":14, "y":3}, + {"label":"Rotary", "x":0, "y":4}, {"label":"Caps", "x":1, "y":4}, {"label":"Opt", "x":2, "y":4, "w":1.25}, {"label":"Cmd", "x":3.25, "y":4, "w":1.25}, {"label":"Space & Shift", "x":4.5, "y":4, "w":2}, {"label":"Space & Raise", "x":6.5, "y":4, "w":2}, {"label":"Cmd", "x":8.5, "y":4, "w":1.25}, {"label":"Opt", "x":9.75, "y":4, "w":1.25}, {"label":"Ctrl", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4} + ] + }, + "LAYOUT_jp": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"&", "x":6, "y":0}, {"label":"'", "x":7, "y":0}, {"label":"(", "x":8, "y":0}, {"label":")", "x":9, "y":0}, {"label":"", "x":10, "y":0}, {"label":"=", "x":11, "y":0}, {"label":"BS", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"|", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"Enter", "x":11.5, "y":1, "w":1.25, "h":2, "r":180, "rx":12.125, "ry":1.5}, {"label":"`", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, + {"label":"Ctrl", "x":0.25, "y":2, "w":1.25}, {"label":"A", "x":1.5, "y":2}, {"label":"S", "x":2.5, "y":2}, {"label":"D", "x":3.5, "y":2}, {"label":"F", "x":4.5, "y":2}, {"label":"G", "x":5.5, "y":2}, {"label":"H", "x":6.5, "y":2}, {"label":"J", "x":7.5, "y":2}, {"label":"K", "x":8.5, "y":2}, {"label":"L", "x":9.5, "y":2}, {"label":"+", "x":10.5, "y":2}, {"label":"*", "x":13, "y":2}, {"label":"}", "x":14, "y":2}, + {"label":"Shift", "x":0.25, "y":3, "w":1.75}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"_", "x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"", "x":14, "y":3}, + {"label":"Rotary", "x":0, "y":4}, {"label":"\u7530", "x":1, "y":4}, {"label":"Alt", "x":2, "y":4, "w":1.25}, {"label":"\u7121\u5909\u63db", "x":3.25, "y":4}, {"label":"Space", "x":4.25, "y":4, "w":2.25}, {"label":"Space", "x":6.5, "y":4, "w":2}, {"label":"\u5909\u63db", "x":8.5, "y":4, "w":1.25}, {"label":"\u30ab\u30ca", "x":9.75, "y":4, "w":1.25}, {"label":"\u76ee", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] + }, + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"", "x":7, "y":0}, {"label":"", "x":8, "y":0}, {"label":"", "x":9, "y":0}, {"label":"", "x":10, "y":0}, {"label":"", "x":11, "y":0}, {"label":"", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"Backspace", "x":11.5, "y":1, "w":1.5}, {"label":"{", "x":13, "y":1}, {"label":"}", "x":14, "y":1}, + {"label":"Ctrl", "x":0.25, "y":2, "w":1.25}, {"label":"A", "x":1.5, "y":2}, {"label":"S", "x":2.5, "y":2}, {"label":"D", "x":3.5, "y":2}, {"label":"F", "x":4.5, "y":2}, {"label":"G", "x":5.5, "y":2}, {"label":"H", "x":6.5, "y":2}, {"label":"J", "x":7.5, "y":2}, {"label":"K", "x":8.5, "y":2}, {"label":"L", "x":9.5, "y":2}, {"label":":", "x":10.5, "y":2}, {"label":"Enter", "x":11.5, "y":2, "w":1.5}, {"label":"\u201d", "x":13, "y":2}, {"label":"\u201d", "x":14, "y":2}, + {"label":"Shift", "x":0.25, "y":3, "w":1.75}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"Fn", "x":14, "y":3}, + {"label":"Rotary", "x":0, "y":4}, {"label":"Caps", "x":1, "y":4}, {"label":"Opt", "x":2, "y":4, "w":1.25}, {"label":"Cmd", "x":3.25, "y":4, "w":1.25}, {"label":"Space & Shift", "x":4.5, "y":4, "w":2}, {"label":"Space & Raise", "x":6.5, "y":4, "w":2}, {"label":"Cmd", "x":8.5, "y":4, "w":1.25}, {"label":"Opt", "x":9.75, "y":4, "w":1.25}, {"label":"Ctrl", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4} + ] + } + } +} diff --git a/keyboards/jones/v03_1/keymaps/default/keymap.c b/keyboards/jones/v03_1/keymaps/default/keymap.c new file mode 100644 index 00000000000..d4716655988 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default/keymap.c @@ -0,0 +1,26 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( + KC_ESC ,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LBRC,KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, XXXXXXX,KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_UP, XXXXXXX, + KC_MUTE,KC_LANG2,KC_LALT,KC_LGUI, KC_SPC, KC_SPC, KC_RGUI,KC_RALT,KC_LANG1,KC_LEFT,KC_DOWN,KC_RGHT + ) +}; \ No newline at end of file diff --git a/keyboards/jones/v03_1/keymaps/default/readme.md b/keyboards/jones/v03_1/keymaps/default/readme.md new file mode 100644 index 00000000000..a23bc4c15a0 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default/readme.md @@ -0,0 +1 @@ +# Defalut keymap for Jones diff --git a/keyboards/jones/v03_1/keymaps/default_ansi/config.h b/keyboards/jones/v03_1/keymaps/default_ansi/config.h new file mode 100644 index 00000000000..0b51190bbe7 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_ansi/config.h @@ -0,0 +1,26 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// double tap to toggle +#define TAPPING_TOGGLE 2 + +// time for long press +#define TAPPING_TERM 200 + +// music map for music-mode +#define MUSIC_MAP diff --git a/keyboards/jones/v03_1/keymaps/default_ansi/keymap.c b/keyboards/jones/v03_1/keymaps/default_ansi/keymap.c new file mode 100644 index 00000000000..e1bc27305f1 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_ansi/keymap.c @@ -0,0 +1,362 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum layer_number { + _MAC = 0, + _WIN, + _NUM, + _LOWER, + _RAISE, + _NUM_RAISE, + _ADJUST +}; + +// Tap Dance +enum tap_dances{ + TD_LSFT_CAPS = 0, + TD_ESC_NUM, +}; + +// Tap Dance state +enum { + SINGLE_TAP = 1, + DOUBLE_TAP, + TRIPLE_TAP, + TAP_HOLD, +}; + +// Declare the functions to be used with your tap dance key(s) +// Function associated with all tap dances +uint8_t cur_dance(qk_tap_dance_state_t *state); +// Functions associated with individual tap dances +void ql_finished(qk_tap_dance_state_t *state, void *user_data); +void ql_reset(qk_tap_dance_state_t *state, void *user_data); + +// Tap Dance definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), + [TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ql_finished, ql_reset, 275), +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MAC = SAFE_RANGE, + WIN, +}; + +// Key Macro +#define ESC_NUM TD(TD_ESC_NUM) +#define S_CAP TD(TD_LSFT_CAPS) +#define SP_RAI LT(_RAISE, KC_SPC) +#define SP_NRAI LT(_NUM_RAISE, KC_SPC) +#define SP_SFT MT(MOD_LSFT, KC_SPC) +#define C_SLSH RCTL_T(KC_SLSH) +#define CT_E LCTL(KC_E) +#define CT_A LCTL(KC_A) +#define ALT_GRV LALT(KC_GRV) +#define LOWER MO(_LOWER) +#define NUM TG(_NUM) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAC] = LAYOUT_ansi( + ESC_NUM,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LBRC,KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, KC_QUOT, + S_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, C_SLSH, KC_RSFT,KC_UP, LOWER, + KC_MUTE,KC_LANG2,KC_LALT,KC_LGUI, SP_SFT, SP_RAI, KC_RGUI,KC_RALT,KC_LANG1,KC_LEFT,KC_DOWN,KC_RGHT + ), + [_WIN] = LAYOUT_ansi( + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,ALT_GRV,KC_LGUI,KC_LALT, _______, _______, KC_RALT,KC_APP, ALT_GRV,_______,_______,_______ + ), + [_NUM] = LAYOUT_ansi( + _______,_______,_______,_______,_______,_______,_______,XXXXXXX,KC_PSLS,KC_PSLS,KC_PAST,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PPLS,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, XXXXXXX,_______, _______, + _______, _______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PENT,_______,_______,_______, + _______,_______,_______,_______, _______, SP_NRAI, KC_P0, KC_PDOT,_______,_______,_______,_______ + ), + [_LOWER] = LAYOUT_ansi( + KC_PAUS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_PSCR, _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_UP, KC_END, KC_VOLU, + _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_LEFT,KC_RGHT, KC_VOLD, + _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PGDN,KC_DOWN,_______,KC_PGUP,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + [_RAISE] = LAYOUT_ansi( + KC_PAUS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_PSCR, _______,_______,CT_E, _______,_______,_______,_______,_______,_______,KC_PGUP,KC_DEL, _______,_______, + _______, CT_A, _______,KC_DEL, KC_RGHT,KC_ESC, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_MINS,KC_INS, _______, + _______, _______,_______,_______,_______,KC_LEFT,KC_PGDN,KC_ENT, _______,KC_MRWD,KC_MFFD,_______,KC_PGUP,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + [_NUM_RAISE] = LAYOUT_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LBRC,KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, KC_QUOT, + S_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, C_SLSH, KC_RSFT,KC_UP, _______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,_______,_______,_______ + ), + [_ADJUST] = LAYOUT_ansi( + _______,RGB_HUI,RGB_SAI,RGB_VAI,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,WIN, _______,RESET, _______,RGB_HUI,RGB_SAI,RGB_VAI,_______,RGB_RMOD,_______, _______,_______, + _______, AU_TOG, CK_TOGG,MU_TOG, MU_MOD, _______,RGB_HUD,RGB_SAD,RGB_VAD,RGB_TOG,RGB_MOD,_______, _______, + _______, CK_RST, CK_DOWN,CK_UP ,_______,_______,NUM, MAC, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,_______,_______,_______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MAC: // Change default ayer --> Write to EEPROM + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case WIN: // Change default ayer --> Write to EEPROM + if (record->event.pressed) { + set_single_persistent_default_layer(_WIN); + } + return false; + break; + default: + break; + } + return true; +} + +//------------------------------------------------------------------------------ +// RGB Light settings +#ifdef RGBLIGHT_LAYERS + +// Indicator LED settings +#define JONES_LED_INDICATOR_INDEX 12 // where to start indicator +#define JONES_LED_INDICATOR_COUNT 2 // how many leds for indicator +#define JONES_LED_INDICATOR_CHANGE_COUNT 1 // how meny leds to change color for temporally layer +#define JONES_LED_DIMMER_LEVEL 200 // brightness dimmer + +// for Default layer (= Base layer) +const rgblight_segment_t PROGMEM my_mac_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_COUNT, HSV_WHITE - JONES_LED_DIMMER_LEVEL} +); +const rgblight_segment_t PROGMEM my_win_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_COUNT, HSV_BLUE - JONES_LED_DIMMER_LEVEL} +); +const rgblight_segment_t PROGMEM my_num_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_COUNT, HSV_YELLOW - JONES_LED_DIMMER_LEVEL} +); + +// for temporal layer +const rgblight_segment_t PROGMEM my_caps_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_MAGENTA - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_GREEN - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_CYAN - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_num_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_GOLD - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_RED - JONES_LED_DIMMER_LEVEL} +); + +// Define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_mac_layer, + my_win_layer, + my_num_layer, + my_caps_layer, + my_lower_layer, + my_raise_layer, + my_num_raise_layer, + my_adjust_layer +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +// Enabling and disabling lighting layers +layer_state_t layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + + rgblight_set_layer_state(2, layer_state_cmp(state, _NUM)); + rgblight_set_layer_state(4, layer_state_cmp(state, _LOWER)); + rgblight_set_layer_state(5, layer_state_cmp(state, _RAISE)); + rgblight_set_layer_state(6, layer_state_cmp(state, _NUM_RAISE)); + rgblight_set_layer_state(7, layer_state_cmp(state, _ADJUST)); + + return state; +} + +// Enabling and disabling lighting layers for default layer +layer_state_t default_layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(0, layer_state_cmp(state, _MAC)); + rgblight_set_layer_state(1, layer_state_cmp(state, _WIN)); + rgblight_set_layer_state(2, layer_state_cmp(state, _NUM)); + + return state; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(3, led_state.caps_lock); + return true; +} +#endif + + +//------------------------------------------------------------------------------ +// Rotary Encoder +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder, Right side */ + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + if (index == 1) { /* Second encoder, Left side */ + switch(biton32(layer_state)) { + case _LOWER: + if (clockwise) { + rgblight_decrease_hue(); + } else { + rgblight_increase_hue(); + } + break; + case _RAISE: + if (clockwise) { + rgblight_decrease_val(); + } else { + rgblight_increase_val(); + } + break; + case _ADJUST: + if (clockwise) { + rgblight_step_reverse(); + } else { + rgblight_step(); + } + break; + default: + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + break; + } + } +} + + +//------------------------------------------------------------------------------ +// Tap Dance function + + +typedef struct { + bool is_press_action; + uint8_t state; +} tap; + +// Determine the current tap dance state +uint8_t cur_dance(qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (!state->pressed) { + return SINGLE_TAP; + } else { + return TAP_HOLD; + } + } else if (state->count == 2) { + if (!state->pressed) { + return DOUBLE_TAP; + } else { + return TAP_HOLD; + } + } else if (state->count == 3) { + if (!state->pressed) { + return TRIPLE_TAP; + } else { + return TAP_HOLD; + } + } else { + return 8; // Magic number. At some point this method will expand to work for more presses + } +} + +// Initialize tap structure associated with example tap dance key +static tap ql_tap_state = { + .is_press_action = true, + .state = 0 +}; + +// Functions that control what our tap dance key does +void ql_finished(qk_tap_dance_state_t *state, void *user_data) { + ql_tap_state.state = cur_dance(state); + switch(state->keycode) { + case TD(TD_ESC_NUM): // ESC key action + switch (ql_tap_state.state) { + case SINGLE_TAP: + case DOUBLE_TAP: + // ESC + tap_code(KC_ESC); + break; + case TAP_HOLD: + // temporal layer change + layer_on(_NUM); + break; + case TRIPLE_TAP: + // toggle layer + // Check to see if the layer is already set + if (layer_state_is(_NUM)) { + // If already set, then switch it off + layer_off(_NUM); + } else { + // If not already set, then switch the layer on + layer_on(_NUM); + } + break; + } + break; + } +} + +void ql_reset(qk_tap_dance_state_t *state, void *user_data) { + switch(state->keycode) { + case TD(TD_ESC_NUM): + // If the key was held down and now is released then switch off the layer + if (ql_tap_state.state == TAP_HOLD) { + layer_off(_NUM); + } + ql_tap_state.state = 0; + break; + } +} diff --git a/keyboards/jones/v03_1/keymaps/default_ansi/readme.md b/keyboards/jones/v03_1/keymaps/default_ansi/readme.md new file mode 100644 index 00000000000..1838a84adc1 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_ansi/readme.md @@ -0,0 +1 @@ +# Defalut ANSI-style keymap for Jones diff --git a/keyboards/jones/v03_1/keymaps/default_ansi/rules.mk b/keyboards/jones/v03_1/keymaps/default_ansi/rules.mk new file mode 100644 index 00000000000..18b26d5c825 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_ansi/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes # Enable Tap Dance \ No newline at end of file diff --git a/keyboards/jones/v03_1/keymaps/default_jp/config.h b/keyboards/jones/v03_1/keymaps/default_jp/config.h new file mode 100644 index 00000000000..0b51190bbe7 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_jp/config.h @@ -0,0 +1,26 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +// double tap to toggle +#define TAPPING_TOGGLE 2 + +// time for long press +#define TAPPING_TERM 200 + +// music map for music-mode +#define MUSIC_MAP diff --git a/keyboards/jones/v03_1/keymaps/default_jp/keymap.c b/keyboards/jones/v03_1/keymaps/default_jp/keymap.c new file mode 100644 index 00000000000..70e4612b6c3 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_jp/keymap.c @@ -0,0 +1,364 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +// Defines names for use in layer keycodes and the keymap +enum layer_number { + _MAC = 0, + _WIN, + _NUM, + _LOWER, + _RAISE, + _NUM_RAISE, + _ADJUST +}; + +// Tap Dance +enum tap_dances{ + TD_LSFT_CAPS = 0, + TD_ESC_NUM, +}; + +// Tap Dance state +enum { + SINGLE_TAP = 1, + DOUBLE_TAP, + TRIPLE_TAP, + TAP_HOLD, +}; + +// Declare the functions to be used with your tap dance key(s) +// Function associated with all tap dances +uint8_t cur_dance(qk_tap_dance_state_t *state); +// Functions associated with individual tap dances +void ql_finished(qk_tap_dance_state_t *state, void *user_data); +void ql_reset(qk_tap_dance_state_t *state, void *user_data); + +// Tap Dance definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), + [TD_ESC_NUM] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ql_finished, ql_reset, 275), +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + MAC = SAFE_RANGE, + WIN, +}; + +// Key Macro +#define ESC_NUM TD(TD_ESC_NUM) +#define S_CAP TD(TD_LSFT_CAPS) +#define SP_RAI LT(_RAISE, KC_SPC) +#define SP_NRAI LT(_NUM_RAISE, KC_SPC) +#define SP_SFT MT(MOD_LSFT, KC_SPC) +#define S_BSLS RSFT_T(JP_BSLS) +#define C_SLSH RCTL_T(JP_SLSH) +#define CT_E LCTL(KC_E) +#define CT_A LCTL(KC_A) +#define ALT_GRV LALT(KC_GRV) +#define LOWER MO(_LOWER) +#define NUM TG(_NUM) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAC] = LAYOUT_jp( + ESC_NUM,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, JP_MINS,KC_BSPC,JP_CIRC,JP_YEN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_SCLN, KC_ENT, JP_COLN,JP_RBRC, + S_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM,JP_DOT, C_SLSH, S_BSLS, KC_UP, LOWER, + KC_MUTE,KC_LALT,KC_LGUI,KC_LANG2, SP_SFT, SP_RAI, KC_LANG1,KC_RGUI,KC_RALT,KC_LEFT,KC_DOWN,KC_RGHT + ), + [_WIN] = LAYOUT_jp( + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______,KC_LGUI,KC_LALT,JP_MHEN, _______, _______, JP_HENK,JP_KANA,KC_APP, _______,_______,_______ + ), + [_NUM] = LAYOUT_jp( + _______,_______,_______,_______,_______,_______,_______,XXXXXXX,KC_PSLS,KC_PSLS,KC_PAST,_______,_______,_______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PPLS, _______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, XXXXXXX,_______, _______,_______, + _______, _______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PENT,_______,_______,_______, + _______,_______,_______,_______, _______, SP_NRAI, KC_P0, KC_PDOT,_______,_______,_______,_______ + ), + [_LOWER] = LAYOUT_jp( + KC_PAUS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_PSCR, _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME, KC_END, KC_VOLU, + _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_LEFT,KC_RGHT, _______,KC_VOLD, + _______, _______,_______,_______,_______,_______,_______,_______,_______,KC_PGDN,KC_DOWN,_______,KC_PGUP,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + [_RAISE] = LAYOUT_jp( + KC_PAUS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_PSCR, _______,_______,CT_E, _______,_______,_______,_______,_______,_______,KC_PGUP, _______,_______, + _______, CT_A, _______,KC_DEL, KC_RGHT,KC_ESC, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,_______,_______, _______,_______, + _______, _______,_______,_______,_______,KC_LEFT,KC_PGDN,KC_ENT, _______,KC_MRWD,KC_MFFD,_______,KC_PGUP,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END + ), + [_NUM_RAISE] = LAYOUT_jp( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, JP_MINS,KC_BSPC,JP_CIRC,JP_YEN, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, JP_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, JP_SCLN, KC_ENT, JP_COLN,JP_RBRC, + S_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, JP_COMM,JP_DOT, C_SLSH, S_BSLS, KC_UP, _______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,_______,_______,_______ + ), + [_ADJUST] = LAYOUT_jp( + _______,RGB_HUI,RGB_SAI,RGB_VAI,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + _______, _______,WIN, _______,RESET, _______,RGB_HUI,RGB_SAI,RGB_VAI,_______,RGB_RMOD, _______,_______, + _______, AU_TOG, CK_TOGG,MU_TOG, MU_MOD, _______,RGB_HUD,RGB_SAD,RGB_VAD,RGB_TOG,RGB_MOD,_______, _______,_______, + _______, CK_RST, CK_DOWN,CK_UP ,_______,_______,NUM, MAC, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______, _______, _______, _______,_______,_______,_______,_______,_______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MAC: // Change default ayer --> Write to EEPROM + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case WIN: // Change default ayer --> Write to EEPROM + if (record->event.pressed) { + set_single_persistent_default_layer(_WIN); + } + return false; + break; + default: + break; + } + return true; +} + +//------------------------------------------------------------------------------ +// RGB Light settings +#ifdef RGBLIGHT_LAYERS + +// Indicator LED settings +#define JONES_LED_INDICATOR_INDEX 12 // where to start indicator +#define JONES_LED_INDICATOR_COUNT 2 // how many leds for indicator +#define JONES_LED_INDICATOR_CHANGE_COUNT 1 // how meny leds to change color for temporally layer +#define JONES_LED_DIMMER_LEVEL 200 // brightness dimmer + +// for Default layer (= Base layer) +const rgblight_segment_t PROGMEM my_mac_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_COUNT, HSV_WHITE - JONES_LED_DIMMER_LEVEL} +); +const rgblight_segment_t PROGMEM my_win_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_COUNT, HSV_BLUE - JONES_LED_DIMMER_LEVEL} +); +const rgblight_segment_t PROGMEM my_num_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_COUNT, HSV_YELLOW - JONES_LED_DIMMER_LEVEL} +); + +// for temporal layer +const rgblight_segment_t PROGMEM my_caps_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_MAGENTA - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_GREEN - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_CYAN - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_num_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_GOLD - JONES_LED_DIMMER_LEVEL} +); + +const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {JONES_LED_INDICATOR_INDEX , JONES_LED_INDICATOR_CHANGE_COUNT, HSV_RED - JONES_LED_DIMMER_LEVEL} +); + +// Define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_mac_layer, + my_win_layer, + my_num_layer, + my_caps_layer, + my_lower_layer, + my_raise_layer, + my_num_raise_layer, + my_adjust_layer +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +// Enabling and disabling lighting layers +layer_state_t layer_state_set_user(layer_state_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + + rgblight_set_layer_state(2, layer_state_cmp(state, _NUM)); + rgblight_set_layer_state(4, layer_state_cmp(state, _LOWER)); + rgblight_set_layer_state(5, layer_state_cmp(state, _RAISE)); + rgblight_set_layer_state(6, layer_state_cmp(state, _NUM_RAISE)); + rgblight_set_layer_state(7, layer_state_cmp(state, _ADJUST)); + + return state; +} + +// Enabling and disabling lighting layers for default layer +layer_state_t default_layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(0, layer_state_cmp(state, _MAC)); + rgblight_set_layer_state(1, layer_state_cmp(state, _WIN)); + rgblight_set_layer_state(2, layer_state_cmp(state, _NUM)); + + return state; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(3, led_state.caps_lock); + return true; +} +#endif + + +//------------------------------------------------------------------------------ +// Rotary Encoder +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder, Right side */ + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + if (index == 1) { /* Second encoder, Left side */ + switch(biton32(layer_state)) { + case _LOWER: + if (clockwise) { + rgblight_decrease_hue(); + } else { + rgblight_increase_hue(); + } + break; + case _RAISE: + if (clockwise) { + rgblight_decrease_val(); + } else { + rgblight_increase_val(); + } + break; + case _ADJUST: + if (clockwise) { + rgblight_step_reverse(); + } else { + rgblight_step(); + } + break; + default: + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + break; + } + } +} + + +//------------------------------------------------------------------------------ +// Tap Dance function + + +typedef struct { + bool is_press_action; + uint8_t state; +} tap; + +// Determine the current tap dance state +uint8_t cur_dance(qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (!state->pressed) { + return SINGLE_TAP; + } else { + return TAP_HOLD; + } + } else if (state->count == 2) { + if (!state->pressed) { + return DOUBLE_TAP; + } else { + return TAP_HOLD; + } + } else if (state->count == 3) { + if (!state->pressed) { + return TRIPLE_TAP; + } else { + return TAP_HOLD; + } + } else { + return 8; // Magic number. At some point this method will expand to work for more presses + } +} + +// Initialize tap structure associated with example tap dance key +static tap ql_tap_state = { + .is_press_action = true, + .state = 0 +}; + +// Functions that control what our tap dance key does +void ql_finished(qk_tap_dance_state_t *state, void *user_data) { + ql_tap_state.state = cur_dance(state); + switch(state->keycode) { + case TD(TD_ESC_NUM): // ESC key action + switch (ql_tap_state.state) { + case SINGLE_TAP: + case DOUBLE_TAP: + // ESC + tap_code(KC_ESC); + break; + case TAP_HOLD: + // temporal layer change + layer_on(_NUM); + break; + case TRIPLE_TAP: + // toggle layer + // Check to see if the layer is already set + if (layer_state_is(_NUM)) { + // If already set, then switch it off + layer_off(_NUM); + } else { + // If not already set, then switch the layer on + layer_on(_NUM); + } + break; + } + break; + } +} + +void ql_reset(qk_tap_dance_state_t *state, void *user_data) { + switch(state->keycode) { + case TD(TD_ESC_NUM): + // If the key was held down and now is released then switch off the layer + if (ql_tap_state.state == TAP_HOLD) { + layer_off(_NUM); + } + ql_tap_state.state = 0; + break; + } +} diff --git a/keyboards/jones/v03_1/keymaps/default_jp/readme.md b/keyboards/jones/v03_1/keymaps/default_jp/readme.md new file mode 100644 index 00000000000..0cb2c18a4cc --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_jp/readme.md @@ -0,0 +1 @@ +# Defalut JP-style keymap for Jones diff --git a/keyboards/jones/v03_1/keymaps/default_jp/rules.mk b/keyboards/jones/v03_1/keymaps/default_jp/rules.mk new file mode 100644 index 00000000000..15d7e0624c0 --- /dev/null +++ b/keyboards/jones/v03_1/keymaps/default_jp/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes # Enable Tap Dance diff --git a/keyboards/jones/v03_1/matrix.c b/keyboards/jones/v03_1/matrix.c new file mode 100644 index 00000000000..9f3e76f935d --- /dev/null +++ b/keyboards/jones/v03_1/matrix.c @@ -0,0 +1,99 @@ +/* +Copyright 2012-2020 Jun Wako, Jack Humbert, Yiancar, Takeshi Nishio + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#include +#include +#include "matrix.h" +#include "quantum.h" + +#define ROW_SHIFTER ((uint16_t)1) + +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +static void select_row(uint8_t row) { + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); +} + +static void unselect_row(uint8_t row) { + setPinInputHigh(row_pins[row]); +} + +static void unselect_rows(void) { + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + setPinInputHigh(row_pins[x]); + } +} + +static void init_pins(void) { + unselect_rows(); + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + setPinInputHigh(col_pins[x]); + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + matrix_io_delay(); + + // For each col... + for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // skip reading when index equals (= pin itself) + if (col_index != current_row) { + // Check col pin pin_state + if (readPin(col_pins[col_index]) == 0) { + // Pin LO, set col bit + current_matrix[current_row] |= (ROW_SHIFTER << col_index); + } else { + // Pin HI, clear col bit + current_matrix[current_row] &= ~(ROW_SHIFTER << col_index); + } + } + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +void matrix_init_custom(void) { + // initialize key pins + init_pins(); + + matrix_init_quantum(); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + bool changed = false; + + // Set row, read cols + for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { + changed |= read_cols_on_row(current_matrix, current_row); + } + + matrix_scan_quantum(); + return changed; +} diff --git a/keyboards/jones/v03_1/readme.md b/keyboards/jones/v03_1/readme.md new file mode 100644 index 00000000000..3cd7bb72e90 --- /dev/null +++ b/keyboards/jones/v03_1/readme.md @@ -0,0 +1,24 @@ +# Jones v.0.3.1 + +![Jones, ANSI style](https://github.com/jpskenn/Jones/raw/master/assets/IMG_2204.jpeg) + +![Jones, JP style](https://github.com/jpskenn/Jones/raw/master/assets/DSC_7189.jpeg) + +A 60% keyboard combined with Ortho-Linear and Row-staggered. It has gapless R2-R3 row. +GH60 case compatible PCB and keyplate. + +* Keyboard Maintainer: [jpskenn](https://github.com/jpskenn) +* Hardware Supported: Jones PCB, Keyplate +* Hardware Availability: [GitHub](https://github.com/jpskenn/Jones), [BOOTH](https://jpskenn.booth.pm) + +Make example for this keyboard (after setting up your build environment): + + make jones/v03_1:default + +Flashing example for this keyboard ([using the command line](https://docs.qmk.fm/#/newbs_flashing?id=flash-your-keyboard-from-the-command-line)): + + make jones/v03_1:default:flash + +To reset the keyboard into bootloader mode, press the reset switch on the underside. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/jones/v03_1/rules.mk b/keyboards/jones/v03_1/rules.mk new file mode 100644 index 00000000000..07203872f0b --- /dev/null +++ b/keyboards/jones/v03_1/rules.mk @@ -0,0 +1,29 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = yes # Audio output + +ENCODER_ENABLE = yes # Rotary Encoder + +CUSTOM_MATRIX = lite # Custom matrix for "Round-Robin Matrix" +SRC += matrix.c + +LTO_ENABLE = yes diff --git a/keyboards/jones/v03_1/v03_1.c b/keyboards/jones/v03_1/v03_1.c new file mode 100644 index 00000000000..33ff0051a68 --- /dev/null +++ b/keyboards/jones/v03_1/v03_1.c @@ -0,0 +1,27 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "v03_1.h" + +#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP) +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_all( + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +); +#endif diff --git a/keyboards/jones/v03_1/v03_1.h b/keyboards/jones/v03_1/v03_1.h new file mode 100644 index 00000000000..38f894c5dd9 --- /dev/null +++ b/keyboards/jones/v03_1/v03_1.h @@ -0,0 +1,105 @@ +/* Copyright 2020 Takeshi Nishio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "quantum.h" + +/* +FULL 11x11 ROUND-ROBIN MATRIX for Reference +{ KC_NO, k21, k31, k41, k51, k61, k71, k81, k91, ka1, kb1 }, \ +{ k12, KC_NO, k32, k42, k52, k62, k72, k82, k92, ka2, kb2 }, \ +{ k13, k23, KC_NO, k43, k53, k63, k73, k83, k93, ka3, kb3 }, \ +{ k14, k24, k34, KC_NO, k54, k64, k74, k84, k94, ka4, kb4 }, \ +{ k15, k25, k35, k45, KC_NO, k65, k75, k85, k95, ka5, kb5 }, \ +{ k16, k26, k36, k46, k56, KC_NO, k76, k86, k96, ka6, kb6 }, \ +{ k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ +{ k18, k28, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ +{ k19, k29, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ +{ k1a, k2a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, kba }, \ +{ k1b, k2b, k3b, k4b, k5b, k6b, k7b, k8b, k9b, kab, KC_NO } \ +*/ + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + k17, k27, k37, k47, k57, k67, k76, k86, k96, ka6, kb6, k81, k91, ka1, kb1, \ + k18, k38, k48, k58, k68, k78, k87, k97, ka7, kb7, k82, k92, ka2, kb2, \ + k19, k39, k49, k59, k69, k79, k89, k98, ka8, kb8, k83, k93, ka3, kb3, \ + k1a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, ka9, kb9, k84, k94, ka4, kb4, \ + k1b, k2b, k3b, k4b, k6b, k8b, k9b, kab, k85, k95, ka5, kb5 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k81, k91, ka1, kb1 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k82, k92, ka2, kb2 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k83, k93, ka3, kb3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k84, k94, ka4, kb4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k85, k95, ka5, kb5 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k76, k86, k96, ka6, kb6 }, \ + { k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ + { k18, KC_NO, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ + { k19, KC_NO, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ + { k1a, KC_NO, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, KC_NO }, \ + { k1b, k2b, k3b, k4b, KC_NO, k6b, KC_NO, k8b, k9b, kab, KC_NO } \ +} + +#define LAYOUT_ansi( \ + k17, k27, k37, k47, k57, k67, k76, k86, k96, ka6, kb6, k81, k91, ka1, kb1, \ + k18, k38, k48, k58, k68, k78, k87, k97, ka7, kb7, k82, k92, ka2, kb2, \ + k19, k39, k49, k59, k69, k79, k89, k98, ka8, kb8, k83, k93, kb3, \ + k1a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, ka9, kb9, k84, k94, ka4, kb4, \ + k1b, k2b, k3b, k4b, k6b, k8b, k9b, kab, k85, k95, ka5, kb5 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k81, k91, ka1, kb1 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k82, k92, ka2, kb2 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k83, k93, KC_NO, kb3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k84, k94, ka4, kb4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k85, k95, ka5, kb5 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k76, k86, k96, ka6, kb6 }, \ + { k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ + { k18, KC_NO, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ + { k19, KC_NO, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ + { k1a, KC_NO, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, KC_NO }, \ + { k1b, k2b, k3b, k4b, KC_NO, k6b, KC_NO, k8b, k9b, kab, KC_NO } \ +} + +#define LAYOUT_jp( \ + k17, k27, k37, k47, k57, k67, k76, k86, k96, ka6, kb6, k81, k91, ka1, kb1, \ + k18, k38, k48, k58, k68, k78, k87, k97, ka7, kb7, k82, ka2, kb2, \ + k19, k39, k49, k59, k69, k79, k89, k98, ka8, kb8, k83, k93, ka3, kb3, \ + k1a, k3a, k4a, k5a, k6a, k7a, k8a, k9a, ka9, kb9, k84, k94, ka4, kb4, \ + k1b, k2b, k3b, k4b, k6b, k8b, k9b, kab, k85, k95, ka5, kb5 \ +) \ +{ \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k81, k91, ka1, kb1 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k82, KC_NO, ka2, kb2 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k83, k93, ka3, kb3 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k84, k94, ka4, kb4 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k85, k95, ka5, kb5 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k76, k86, k96, ka6, kb6 }, \ + { k17, k27, k37, k47, k57, k67, KC_NO, k87, k97, ka7, kb7 }, \ + { k18, KC_NO, k38, k48, k58, k68, k78, KC_NO, k98, ka8, kb8 }, \ + { k19, KC_NO, k39, k49, k59, k69, k79, k89, KC_NO, ka9, kb9 }, \ + { k1a, KC_NO, k3a, k4a, k5a, k6a, k7a, k8a, k9a, KC_NO, KC_NO }, \ + { k1b, k2b, k3b, k4b, KC_NO, k6b, KC_NO, k8b, k9b, kab, KC_NO } \ +}