y-temp4/quambu

View on GitHub

Showing 12 of 12 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    fetchUserSubData(`${GOT_USER_DATA_URI}/following_tags`)
      .then((tags) => {
        this.setState({ following_tags: tags });
        localStorage.setItem('following_tags', tags);
        // ユーザーがフォローしているタグに紐づく記事をstateに保存
Severity: Major
Found in src/components/app.jsx and 1 other location - About 4 hrs to fix
src/components/app.jsx on lines 81..91

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    fetchUserSubData(`${GOT_USER_DATA_URI}/followees`)
      .then((users) => {
        this.setState({ following_users: users });
        localStorage.setItem('following_users', users);
        // ユーザーがフォローしているユーザーに紐づく記事をstateに保存
Severity: Major
Found in src/components/app.jsx and 1 other location - About 4 hrs to fix
src/components/app.jsx on lines 68..78

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <Col xs={12} lg={4} style={{ padding: 10 }}>
              {
                this.getItemList({
                  title: `${this.state.username} following user's items`,
                  items: this.state.following_users_related_items,
Severity: Major
Found in src/components/app.jsx and 1 other location - About 4 hrs to fix
src/components/app.jsx on lines 120..129

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 118.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <Col xs={12} lg={4} style={{ padding: 10 }}>
              {
                this.getItemList({
                  title: `${this.state.username} following tag's items`,
                  items: this.state.following_tags_related_items,
Severity: Major
Found in src/components/app.jsx and 1 other location - About 4 hrs to fix
src/components/app.jsx on lines 130..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 118.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
      <div>
        <Header toggleDrower={this.toggleDrower} />
        <SideMenu
Severity: Major
Found in src/components/app.jsx - About 2 hrs to fix

    Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const { items, bookmarkCount, stockCount, hasSubData, message, title } = this.props;
        const filteredItems =
          items.slice(0, 20).filter(item => this.refineByCount(item, bookmarkCount, stockCount));
        if (!hasSubData) {
    Severity: Minor
    Found in src/components/item-list.jsx - About 1 hr to fix

      'result' is defined but never used.
      Open

      }).listen(3333, 'localhost', (err, result) => {
      Severity: Minor
      Found in server.js by eslint

      Disallow Unused Variables (no-unused-vars)

      Variables that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers.

      Rule Details

      This rule is aimed at eliminating unused variables, functions, and parameters of functions.

      A variable is considered to be used if any of the following are true:

      • It represents a function that is called (doSomething())
      • It is read (var y = x)
      • It is passed into a function as an argument (doSomething(x))
      • It is read inside of a function that is passed to another function (doSomething(function() { foo(); }))

      A variable is not considered to be used if it is only ever assigned to (var x = 5) or declared.

      Examples of incorrect code for this rule:

      /*eslint no-unused-vars: "error"*/
      /*global some_unused_var*/
      
      // It checks variables you have defined as global
      some_unused_var = 42;
      
      var x;
      
      // Write-only variables are not considered as used.
      var y = 10;
      y = 5;
      
      // A read for a modification of itself is not considered as used.
      var z = 0;
      z = z + 1;
      
      // By default, unused arguments cause warnings.
      (function(foo) {
          return 5;
      })();
      
      // Unused recursive functions also cause warnings.
      function fact(n) {
          if (n < 2) return 1;
          return n * fact(n - 1);
      }
      
      // When a function definition destructures an array, unused entries from the array also cause warnings.
      function getY([x, y]) {
          return y;
      }

      Examples of correct code for this rule:

      /*eslint no-unused-vars: "error"*/
      
      var x = 10;
      alert(x);
      
      // foo is considered used here
      myFunc(function foo() {
          // ...
      }.bind(this));
      
      (function(foo) {
          return foo;
      })();
      
      var myFunc;
      myFunc = setTimeout(function() {
          // myFunc is considered used
          myFunc();
      }, 50);
      
      // Only the second argument from the descructured array is used.
      function getY([, y]) {
          return y;
      }

      exported

      In environments outside of CommonJS or ECMAScript modules, you may use var to create a global variable that may be used by other scripts. You can use the /* exported variableName */ comment block to indicate that this variable is being exported and therefore should not be considered unused.

      Note that /* exported */ has no effect for any of the following:

      • when the environment is node or commonjs
      • when parserOptions.sourceType is module
      • when ecmaFeatures.globalReturn is true

      The line comment // exported variableName will not work as exported is not line-specific.

      Examples of correct code for /* exported variableName */ operation:

      /* exported global_var */
      
      var global_var = 42;

      Options

      This rule takes one argument which can be a string or an object. The string settings are the same as those of the vars property (explained below).

      By default this rule is enabled with all option for variables and after-used for arguments.

      {
          "rules": {
              "no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
          }
      }

      vars

      The vars option has two settings:

      • all checks all variables for usage, including those in the global scope. This is the default setting.
      • local checks only that locally-declared variables are used but will allow global variables to be unused.

      vars: local

      Examples of correct code for the { "vars": "local" } option:

      /*eslint no-unused-vars: ["error", { "vars": "local" }]*/
      /*global some_unused_var */
      
      some_unused_var = 42;

      varsIgnorePattern

      The varsIgnorePattern option specifies exceptions not to check for usage: variables whose names match a regexp pattern. For example, variables whose names contain ignored or Ignored.

      Examples of correct code for the { "varsIgnorePattern": "[iI]gnored" } option:

      /*eslint no-unused-vars: ["error", { "varsIgnorePattern": "[iI]gnored" }]*/
      
      var firstVarIgnored = 1;
      var secondVar = 2;
      console.log(secondVar);

      args

      The args option has three settings:

      • after-used - only the last argument must be used. This allows you, for instance, to have two named parameters to a function and as long as you use the second argument, ESLint will not warn you about the first. This is the default setting.
      • all - all named arguments must be used.
      • none - do not check arguments.

      args: after-used

      Examples of incorrect code for the default { "args": "after-used" } option:

      /*eslint no-unused-vars: ["error", { "args": "after-used" }]*/
      
      // 1 error
      // "baz" is defined but never used
      (function(foo, bar, baz) {
          return bar;
      })();

      Examples of correct code for the default { "args": "after-used" } option:

      /*eslint no-unused-vars: ["error", {"args": "after-used"}]*/
      
      (function(foo, bar, baz) {
          return baz;
      })();

      args: all

      Examples of incorrect code for the { "args": "all" } option:

      /*eslint no-unused-vars: ["error", { "args": "all" }]*/
      
      // 2 errors
      // "foo" is defined but never used
      // "baz" is defined but never used
      (function(foo, bar, baz) {
          return bar;
      })();

      args: none

      Examples of correct code for the { "args": "none" } option:

      /*eslint no-unused-vars: ["error", { "args": "none" }]*/
      
      (function(foo, bar, baz) {
          return bar;
      })();

      ignoreRestSiblings

      The ignoreRestSiblings option is a boolean (default: false). Using a Rest Property it is possible to "omit" properties from an object, but by default the sibling properties are marked as "unused". With this option enabled the rest property's siblings are ignored.

      Examples of correct code for the { "ignoreRestSiblings": true } option:

      /*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
      // 'type' is ignored because it has a rest property sibling.
      var { type, ...coords } = data;

      argsIgnorePattern

      The argsIgnorePattern option specifies exceptions not to check for usage: arguments whose names match a regexp pattern. For example, variables whose names begin with an underscore.

      Examples of correct code for the { "argsIgnorePattern": "^_" } option:

      /*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/
      
      function foo(x, _y) {
          return x + 1;
      }
      foo();

      caughtErrors

      The caughtErrors option is used for catch block arguments validation.

      It has two settings:

      • none - do not check error objects. This is the default setting.
      • all - all named arguments must be used.

      caughtErrors: none

      Not specifying this rule is equivalent of assigning it to none.

      Examples of correct code for the { "caughtErrors": "none" } option:

      /*eslint no-unused-vars: ["error", { "caughtErrors": "none" }]*/
      
      try {
          //...
      } catch (err) {
          console.error("errors");
      }

      caughtErrors: all

      Examples of incorrect code for the { "caughtErrors": "all" } option:

      /*eslint no-unused-vars: ["error", { "caughtErrors": "all" }]*/
      
      // 1 error
      // "err" is defined but never used
      try {
          //...
      } catch (err) {
          console.error("errors");
      }

      caughtErrorsIgnorePattern

      The caughtErrorsIgnorePattern option specifies exceptions not to check for usage: catch arguments whose names match a regexp pattern. For example, variables whose names begin with a string 'ignore'.

      Examples of correct code for the { "caughtErrorsIgnorePattern": "^ignore" } option:

      /*eslint no-unused-vars: ["error", { "caughtErrorsIgnorePattern": "^ignore" }]*/
      
      try {
          //...
      } catch (ignoreErr) {
          console.error("errors");
      }

      When Not To Use It

      If you don't want to be notified about unused variables or function arguments, you can safely turn this rule off. Source: http://eslint.org/docs/rules/

      Expected to return a value at the end of arrow function.
      Open

      }).listen(3333, 'localhost', (err, result) => {
      Severity: Minor
      Found in server.js by eslint

      require return statements to either always or never specify values (consistent-return)

      Unlike statically-typed languages which enforce that a function returns a specified type of value, JavaScript allows different code paths in a function to return different types of values.

      A confusing aspect of JavaScript is that a function returns undefined if any of the following are true:

      • it does not execute a return statement before it exits
      • it executes return which does not specify a value explicitly
      • it executes return undefined
      • it executes return void followed by an expression (for example, a function call)
      • it executes return followed by any other expression which evaluates to undefined

      If any code paths in a function return a value explicitly but some code path do not return a value explicitly, it might be a typing mistake, especially in a large function. In the following example:

      • a code path through the function returns a Boolean value true
      • another code path does not return a value explicitly, therefore returns undefined implicitly
      function doSomething(condition) {
          if (condition) {
              return true;
          } else {
              return;
          }
      }

      Rule Details

      This rule requires return statements to either always or never specify values. This rule ignores function definitions where the name begins with an uppercase letter, because constructors (when invoked with the new operator) return the instantiated object implicitly if they do not return another object explicitly.

      Examples of incorrect code for this rule:

      /*eslint consistent-return: "error"*/
      
      function doSomething(condition) {
          if (condition) {
              return true;
          } else {
              return;
          }
      }
      
      function doSomething(condition) {
          if (condition) {
              return true;
          }
      }

      Examples of correct code for this rule:

      /*eslint consistent-return: "error"*/
      
      function doSomething(condition) {
          if (condition) {
              return true;
          } else {
              return false;
          }
      }
      
      function Foo() {
          if (!(this instanceof Foo)) {
              return new Foo();
          }
      
          this.a = 0;
      }

      Options

      This rule has an object option:

      • "treatUndefinedAsUnspecified": false (default) always either specify values or return undefined implicitly only.
      • "treatUndefinedAsUnspecified": true always either specify values or return undefined explicitly or implicitly.

      treatUndefinedAsUnspecified

      Examples of incorrect code for this rule with the default { "treatUndefinedAsUnspecified": false } option:

      /*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": false }]*/
      
      function foo(callback) {
          if (callback) {
              return void callback();
          }
          // no return statement
      }
      
      function bar(condition) {
          if (condition) {
              return undefined;
          }
          // no return statement
      }

      Examples of incorrect code for this rule with the { "treatUndefinedAsUnspecified": true } option:

      /*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
      
      function foo(callback) {
          if (callback) {
              return void callback();
          }
          return true;
      }
      
      function bar(condition) {
          if (condition) {
              return undefined;
          }
          return true;
      }

      Examples of correct code for this rule with the { "treatUndefinedAsUnspecified": true } option:

      /*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
      
      function foo(callback) {
          if (callback) {
              return void callback();
          }
          // no return statement
      }
      
      function bar(condition) {
          if (condition) {
              return undefined;
          }
          // no return statement
      }

      When Not To Use It

      If you want to allow functions to have different return behavior depending on code branching, then it is safe to disable this rule. Source: http://eslint.org/docs/rules/

      Unexpected console statement.
      Open

          return console.log(err);
      Severity: Minor
      Found in server.js by eslint

      disallow the use of console (no-console)

      In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using console should be stripped before being pushed to production.

      console.log("Made it here.");
      console.error("That shouldn't have happened.");

      Rule Details

      This rule disallows calls to methods of the console object.

      Examples of incorrect code for this rule:

      /*eslint no-console: "error"*/
      
      console.log("Log a debug level message.");
      console.warn("Log a warn level message.");
      console.error("Log an error level message.");

      Examples of correct code for this rule:

      /*eslint no-console: "error"*/
      
      // custom console
      Console.log("Hello world!");

      Options

      This rule has an object option for exceptions:

      • "allow" has an array of strings which are allowed methods of the console object

      Examples of additional correct code for this rule with a sample { "allow": ["warn", "error"] } option:

      /*eslint no-console: ["error", { allow: ["warn", "error"] }] */
      
      console.warn("Log a warn level message.");
      console.error("Log an error level message.");

      When Not To Use It

      If you're using Node.js, however, console is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.

      Related Rules

      Unexpected console statement.
      Open

        console.log('Listening at http://localhost:3333/');
      Severity: Minor
      Found in server.js by eslint

      disallow the use of console (no-console)

      In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using console should be stripped before being pushed to production.

      console.log("Made it here.");
      console.error("That shouldn't have happened.");

      Rule Details

      This rule disallows calls to methods of the console object.

      Examples of incorrect code for this rule:

      /*eslint no-console: "error"*/
      
      console.log("Log a debug level message.");
      console.warn("Log a warn level message.");
      console.error("Log an error level message.");

      Examples of correct code for this rule:

      /*eslint no-console: "error"*/
      
      // custom console
      Console.log("Hello world!");

      Options

      This rule has an object option for exceptions:

      • "allow" has an array of strings which are allowed methods of the console object

      Examples of additional correct code for this rule with a sample { "allow": ["warn", "error"] } option:

      /*eslint no-console: ["error", { allow: ["warn", "error"] }] */
      
      console.warn("Log a warn level message.");
      console.error("Log an error level message.");

      When Not To Use It

      If you're using Node.js, however, console is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.

      Related Rules

      TODO found
      Open

          "raw_body": "\n## 前提\n\n- MacOSX\n- HHK TypeS(無刻印) => ErgoDoxEZ(無刻印)\n- Dvorak歴半年程度\n\nもともと無刻印ユーザーなので、レイアウトが動的に切り替わるのは違和感がない。\n\n## 雑感\n\nセパレートはやはり肩こりに効く感じがある。これが収穫大。(これだけだったらKinesisでもいいんだが)\nMac/Dvorak/ErgoDoxEZという組み合わせで、あんまり参考になる設定がないので、とりあえず毎日ガチャガチャキーマップを書き換えている。デフォルトキーマップはかなり癖があるので、書き換えないと辛い。\n\n生産性は使い始めた初日で30%程度。\n3日経過で60%。\n一週間経過(今)で80%。\n\nまだまだ伸びしろあるはず。\n\n## 周辺ツールの設定\n\nKarabinerでDvorakに設定したが、多段変換される都合でErgoDoxの設定が複雑になるので、KarabinerでQwertyのプロファイルをもう1個作ってメニューに表示し、マウスで切り替えられるようにした。\n\nノートPCなので、何かとErgoDox使わない環境は残しておかないと不便\n\n## 今抱えている問題\n\n押さえっぱなしとタップで挙動を切り替えるやつ便利じゃん、と思って使いまくったら、内部の都合なのかしら知らないが、複数のメタキーを使ったあとにメタキーがおしっぱなしになり戻らないことが多々あった。その周辺キーをガチャガチャやったり、USB抜き差しで治る。今はその設定を最小限にしたら多少マシになった。\n\n調べた結果、レイヤー切り替えキーを押した後、その下に別のキーが設定されているときの挙動が怪しかったので、今は触れないようにしている。\n\n## 読むといい記事\n\n- http://qiita.com/ReSTARTR/items/f84f8f3c4c51c876cb2f\n- http://qiita.com/ReSTARTR/items/970354940f49c67fb9fd\n\n## あるといいもの\n\n- 安全ピン\n\nまち針でもなんでもいいんだけど、なんだかんだでハードリセットキーをよく押すので\n\n## 今現在の keymap.c\n\n```c\n#include \"ergodox_ez.h\"\n#include \"debug.h\"\n#include \"action_layer.h\"\n\n#define BASE 0 // default layer\n#define SYMB 1 // symbols\n#define MDIA 2 // media keys\n\nconst uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n/* Keymap 0: Basic layer\n *\n * ,--------------------------------------------------.           ,--------------------------------------------------.\n * |   ESC  |   1  |   2  |   3  |   4  |   5  |  6   |           |   7  |   8  |   9  |   0  |   +  |   =  |   \\    |\n * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|\n * |   TAB  |   '  |   ,  |   .  |   P  |   Y  |  L1  |           |  L1  |   F  |   G  |   C  |   R  |   L  |   /    |\n * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|\n * |  LCTR  |   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   H  |   T  |   N  | S/L2 |   -    |\n * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|\n * | LShift |   :  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  | Z/L1 | RShift |\n * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'\n *   |L1    |ESC/L1| LCTRL| LALT | LGUI |                                       | RGUI |   =  |   [  |   ]  | ~L1  |\n *   `----------------------------------'                                       `----------------------------------'\n *                                        ,-------------.       ,---------------.\n *                                        | LALT | LGui |       | Alt  |Ctrl/Esc|\n *                                 ,------|------|------|       |------+--------+------.\n *                                 |      |      | Home |       | PgUp |        |      |\n *                                 | Space|Backsp|------|       |------|  Tab   |Enter |\n *                                 |      |ace   | End  |       | PgDn |        |      |\n *                                 `--------------------'       `----------------------'\n */\n// If it accepts an argument (i.e, is a function), it doesn't need KC_.\n// Otherwise, it needs KC_*\n[BASE] = KEYMAP(  // layer 0 : default\n        // left hand\n        KC_ESC,         KC_1,           KC_2,    KC_3,   KC_4,   KC_5,   KC_6,\n        KC_TAB,       KC_QUOT,        KC_COMM, KC_DOT, KC_P,   KC_Y,   TG(1),\n        KC_LCTRL,       KC_A,           KC_O,    KC_E,   KC_U,   KC_I,\n\n        KC_LSFT,        KC_SCLN, KC_Q,    KC_J,   KC_K,   KC_X,   KC_NO,\n     LT(SYMB,KC_NO), LT(SYMB, KC_ESC), KC_LCTRL,   KC_LALT,  KC_LGUI,\n                                                  KC_LALT,  KC_LGUI,\n                                                             KC_HOME,\n                                               KC_SPC,KC_BSPC,KC_END,\n        // right hand\n        KC_7,        KC_8,   KC_9,      KC_0,      KC_PLUS,  KC_EQL,         KC_BSLS,\n        TG(SYMB),    KC_F,   KC_G,      KC_C,      KC_R,   KC_L,             KC_SLSH,\n                     KC_D,   KC_H,      KC_T,      KC_N,   LT(MDIA, KC_S),   KC_MINS,\n        KC_NO,       KC_B,   KC_M,      KC_W,      KC_V,   LT(SYMB, KC_Z),   KC_RSFT,\n                              KC_RGUI,   KC_EQL, KC_LBRC,KC_RBRC,             KC_FN1,\n        KC_LALT,        CTL_T(KC_ESC),\n        KC_PGUP,\n        KC_PGDN,KC_TAB, KC_ENT\n    ),\n/* Keymap 1: Symbol Layer\n *\n * ,--------------------------------------------------.           ,--------------------------------------------------.\n * |    =   |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |           |   F7 |  F8  |  F9  |  F10 |  F11 |  F12 |        |\n * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|\n * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |        |\n * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|\n * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |\n * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|\n * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &  |   1  |   2  |   3  |      |        |\n * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'\n *   |      |      |      |      |   =  |                                       |      |    . |   0  |   =  |      |\n *   `----------------------------------'                                       `----------------------------------'\n *                                        ,-------------.       ,-------------.\n *                                        |      |      |       |      |      |\n *                                 ,------|------|------|       |------+------+------.\n *                                 |      |      |      |       |      |      |      |\n *                                 |      |      |------|       |------|      |      |\n *                                 |      |      |      |       |      |      |      |\n *                                 `--------------------'       `--------------------'\n */\n// SYMBOLS\n[SYMB] = KEYMAP(\n       // left hand\n       KC_EQL ,KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,\n       KC_TRNS,KC_EXLM,KC_AT,  KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,\n       KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_TRNS,\n       KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,\n       KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,\n                                       KC_TRNS,KC_TRNS,\n                                               KC_TRNS,\n                               KC_TRNS,KC_TRNS,KC_TRNS,\n       // right hand\n       KC_F7,   KC_F8,   KC_F9,  KC_F10,  KC_F11,  KC_F12,  KC_TRNS,\n       KC_TRNS, KC_UP,   KC_7,   KC_8,    KC_9,    KC_ASTR, KC_F12,\n                KC_DOWN, KC_4,   KC_5,    KC_6,    KC_PLUS, KC_TRNS,\n       KC_TRNS, KC_AMPR, KC_1,   KC_2,    KC_3,    KC_TRNS, KC_TRNS,\n                         KC_TRNS,KC_DOT,  KC_0,    KC_EQL,  KC_TRNS,\n       KC_TRNS, KC_TRNS,\n       KC_TRNS,\n       KC_TRNS, KC_TRNS, KC_TRNS\n),\n/* Keymap 2: Media and mouse keys\n *\n * ,--------------------------------------------------.           ,--------------------------------------------------.\n * |  RESET |      |      |      |      |      |      |           |      |      |      |      |      |      |        |\n * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|\n * |        |      | Lclk | MsUp | Rclk |      |      |           |      |      | PGDN |  UP  | PGUP |      |        |\n * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|\n * |        |      |MsLeft|MsDown|MsRght|      |------|           |------| BSPC | LEFT | DOWN |RIGHT |      |  Play  |\n * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|\n * |        |      |      |      |      |      |      |           |      |      | HOME | ESC  | END  |      |        |\n * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'\n *   |      |      |      | Lclk | Rclk |                                       |VolDn |VolUp | Mute |      |      |\n *   `----------------------------------'                                       `----------------------------------'\n *                                        ,-------------.       ,-------------.\n *                                        |      |      |       |      |      |\n *                                 ,------|------|------|       |------+------+------.\n *                                 |      |      |      |       |      |      |Brwser|\n *                                 | Lclk | Rclk |------|       |------|      |Back  |\n *                                 |      |      |      |       |      |      |      |\n *                                 `--------------------'       `--------------------'\n */\n// MEDIA AND MOUS\nKEYMAP(\n       KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\n       KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS,\n       KC_TRNS, KC_BSPC, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,\n       KC_TRNS, KC_TRNS, KC_TRNS, KC_ESC,  KC_TRNS, KC_TRNS, KC_TRNS,\n       KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,\n                                           KC_TRNS, KC_TRNS,\n                                                    KC_TRNS,\n                                  KC_BTN1, KC_BTN2, KC_TRNS,\n    // right hand\n       KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\n       KC_TRNS,  KC_TRNS, KC_PGDN, KC_UP  , KC_PGUP, KC_TRNS, KC_TRNS,\n                 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY,\n       KC_TRNS,  KC_TRNS, KC_HOME, KC_TRNS, KC_END, KC_TRNS, KC_TRNS,\n                          KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS,\n       KC_TRNS, KC_TRNS,\n       KC_TRNS,\n       KC_TRNS, KC_TRNS, KC_RALT\n),\n};\n\nconst uint16_t PROGMEM fn_actions[] = {\n    [1] = ACTION_LAYER_TAP_TOGGLE(SYMB)                // FN1 - Momentary Layer 1 (Symbols)\n};\n\nconst macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)\n{\n  // MACRODOWN only works in this function\n      switch(id) {\n        case 0:\n        if (record->event.pressed) {\n          register_code(KC_RSFT);\n        } else {\n          unregister_code(KC_RSFT);\n        }\n        break;\n      }\n    return MACRO_NONE;\n};\n\n// Runs just one time when the keyboard initializes.\nvoid matrix_init_user(void) {\n\n};\n\n// Runs constantly in the background, in a loop.\nvoid matrix_scan_user(void) {\n\n    uint8_t layer = biton32(layer_state);\n\n    ergodox_board_led_off();\n    ergodox_right_led_1_off();\n    ergodox_right_led_2_off();\n    ergodox_right_led_3_off();\n    switch (layer) {\n      // TODO: Make this relevant to the ErgoDox EZ.\n        case 1:\n            ergodox_right_led_1_on();\n            break;\n        case 2:\n            ergodox_right_led_2_on();\n            break;\n        default:\n            // none\n            break;\n    }\n\n};\n```\n",

      TODO found
      Open

          "body": "\n<h2>\n<span id=\"前提\" class=\"fragment\"></span><a href=\"#%E5%89%8D%E6%8F%90\"><i class=\"fa fa-link\"></i></a>前提</h2>\n\n<ul>\n<li>MacOSX</li>\n<li>HHK TypeS(無刻印) =&gt; ErgoDoxEZ(無刻印)</li>\n<li>Dvorak歴半年程度</li>\n</ul>\n\n<p>もともと無刻印ユーザーなので、レイアウトが動的に切り替わるのは違和感がない。</p>\n\n<h2>\n<span id=\"雑感\" class=\"fragment\"></span><a href=\"#%E9%9B%91%E6%84%9F\"><i class=\"fa fa-link\"></i></a>雑感</h2>\n\n<p>セパレートはやはり肩こりに効く感じがある。これが収穫大。(これだけだったらKinesisでもいいんだが)<br>\nMac/Dvorak/ErgoDoxEZという組み合わせで、あんまり参考になる設定がないので、とりあえず毎日ガチャガチャキーマップを書き換えている。デフォルトキーマップはかなり癖があるので、書き換えないと辛い。</p>\n\n<p>生産性は使い始めた初日で30%程度。<br>\n3日経過で60%。<br>\n一週間経過(今)で80%。</p>\n\n<p>まだまだ伸びしろあるはず。</p>\n\n<h2>\n<span id=\"周辺ツールの設定\" class=\"fragment\"></span><a href=\"#%E5%91%A8%E8%BE%BA%E3%83%84%E3%83%BC%E3%83%AB%E3%81%AE%E8%A8%AD%E5%AE%9A\"><i class=\"fa fa-link\"></i></a>周辺ツールの設定</h2>\n\n<p>KarabinerでDvorakに設定したが、多段変換される都合でErgoDoxの設定が複雑になるので、KarabinerでQwertyのプロファイルをもう1個作ってメニューに表示し、マウスで切り替えられるようにした。</p>\n\n<p>ノートPCなので、何かとErgoDox使わない環境は残しておかないと不便</p>\n\n<h2>\n<span id=\"今抱えている問題\" class=\"fragment\"></span><a href=\"#%E4%BB%8A%E6%8A%B1%E3%81%88%E3%81%A6%E3%81%84%E3%82%8B%E5%95%8F%E9%A1%8C\"><i class=\"fa fa-link\"></i></a>今抱えている問題</h2>\n\n<p>押さえっぱなしとタップで挙動を切り替えるやつ便利じゃん、と思って使いまくったら、内部の都合なのかしら知らないが、複数のメタキーを使ったあとにメタキーがおしっぱなしになり戻らないことが多々あった。その周辺キーをガチャガチャやったり、USB抜き差しで治る。今はその設定を最小限にしたら多少マシになった。</p>\n\n<p>調べた結果、レイヤー切り替えキーを押した後、その下に別のキーが設定されているときの挙動が怪しかったので、今は触れないようにしている。</p>\n\n<h2>\n<span id=\"読むといい記事\" class=\"fragment\"></span><a href=\"#%E8%AA%AD%E3%82%80%E3%81%A8%E3%81%84%E3%81%84%E8%A8%98%E4%BA%8B\"><i class=\"fa fa-link\"></i></a>読むといい記事</h2>\n\n<ul>\n<li><a href=\"http://qiita.com/ReSTARTR/items/f84f8f3c4c51c876cb2f\" class=\"autolink\" id=\"reference-7903fa2f4f5c06008bc1\">http://qiita.com/ReSTARTR/items/f84f8f3c4c51c876cb2f</a></li>\n<li><a href=\"http://qiita.com/ReSTARTR/items/970354940f49c67fb9fd\" class=\"autolink\" id=\"reference-ef2f1d02f76e060ec161\">http://qiita.com/ReSTARTR/items/970354940f49c67fb9fd</a></li>\n</ul>\n\n<h2>\n<span id=\"あるといいもの\" class=\"fragment\"></span><a href=\"#%E3%81%82%E3%82%8B%E3%81%A8%E3%81%84%E3%81%84%E3%82%82%E3%81%AE\"><i class=\"fa fa-link\"></i></a>あるといいもの</h2>\n\n<ul>\n<li>安全ピン</li>\n</ul>\n\n<p>まち針でもなんでもいいんだけど、なんだかんだでハードリセットキーをよく押すので</p>\n\n<h2>\n<span id=\"今現在の-keymapc\" class=\"fragment\"></span><a href=\"#%E4%BB%8A%E7%8F%BE%E5%9C%A8%E3%81%AE-keymapc\"><i class=\"fa fa-link\"></i></a>今現在の keymap.c</h2>\n\n<div class=\"code-frame\" data-lang=\"c\"><div class=\"highlight\"><pre>\n<span class=\"cp\">#include \"ergodox_ez.h\"</span>\n<span class=\"cp\">#include \"debug.h\"</span>\n<span class=\"cp\">#include \"action_layer.h\"</span>\n\n<span class=\"cp\">#define BASE 0 </span><span class=\"c1\">// default layer</span>\n<span class=\"cp\">#define SYMB 1 </span><span class=\"c1\">// symbols</span>\n<span class=\"cp\">#define MDIA 2 </span><span class=\"c1\">// media keys</span>\n\n<span class=\"k\">const</span> <span class=\"kt\">uint16_t</span> <span class=\"n\">PROGMEM</span> <span class=\"n\">keymaps</span><span class=\"p\">[][</span><span class=\"n\">MATRIX_ROWS</span><span class=\"p\">][</span><span class=\"n\">MATRIX_COLS</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"p\">{</span>\n<span class=\"cm\">/* Keymap 0: Basic layer</span>\n<span class=\"cm\"> *</span>\n<span class=\"cm\"> * ,--------------------------------------------------.           ,--------------------------------------------------.</span>\n<span class=\"cm\"> * |   ESC  |   1  |   2  |   3  |   4  |   5  |  6   |           |   7  |   8  |   9  |   0  |   +  |   =  |   \\    |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |   TAB  |   '  |   ,  |   .  |   P  |   Y  |  L1  |           |  L1  |   F  |   G  |   C  |   R  |   L  |   /    |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |  LCTR  |   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   H  |   T  |   N  | S/L2 |   -    |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * | LShift |   :  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  | Z/L1 | RShift |</span>\n<span class=\"cm\"> * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'</span>\n<span class=\"cm\"> *   |L1    |ESC/L1| LCTRL| LALT | LGUI |                                       | RGUI |   =  |   [  |   ]  | ~L1  |</span>\n<span class=\"cm\"> *   `----------------------------------'                                       `----------------------------------'</span>\n<span class=\"cm\"> *                                        ,-------------.       ,---------------.</span>\n<span class=\"cm\"> *                                        | LALT | LGui |       | Alt  |Ctrl/Esc|</span>\n<span class=\"cm\"> *                                 ,------|------|------|       |------+--------+------.</span>\n<span class=\"cm\"> *                                 |      |      | Home |       | PgUp |        |      |</span>\n<span class=\"cm\"> *                                 | Space|Backsp|------|       |------|  Tab   |Enter |</span>\n<span class=\"cm\"> *                                 |      |ace   | End  |       | PgDn |        |      |</span>\n<span class=\"cm\"> *                                 `--------------------'       `----------------------'</span>\n<span class=\"cm\"> */</span>\n<span class=\"c1\">// If it accepts an argument (i.e, is a function), it doesn't need KC_.</span>\n<span class=\"c1\">// Otherwise, it needs KC_*</span>\n<span class=\"p\">[</span><span class=\"n\">BASE</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">KEYMAP</span><span class=\"p\">(</span>  <span class=\"c1\">// layer 0 : default</span>\n        <span class=\"c1\">// left hand</span>\n        <span class=\"n\">KC_ESC</span><span class=\"p\">,</span>         <span class=\"n\">KC_1</span><span class=\"p\">,</span>           <span class=\"n\">KC_2</span><span class=\"p\">,</span>    <span class=\"n\">KC_3</span><span class=\"p\">,</span>   <span class=\"n\">KC_4</span><span class=\"p\">,</span>   <span class=\"n\">KC_5</span><span class=\"p\">,</span>   <span class=\"n\">KC_6</span><span class=\"p\">,</span>\n        <span class=\"n\">KC_TAB</span><span class=\"p\">,</span>       <span class=\"n\">KC_QUOT</span><span class=\"p\">,</span>        <span class=\"n\">KC_COMM</span><span class=\"p\">,</span> <span class=\"n\">KC_DOT</span><span class=\"p\">,</span> <span class=\"n\">KC_P</span><span class=\"p\">,</span>   <span class=\"n\">KC_Y</span><span class=\"p\">,</span>   <span class=\"n\">TG</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">),</span>\n        <span class=\"n\">KC_LCTRL</span><span class=\"p\">,</span>       <span class=\"n\">KC_A</span><span class=\"p\">,</span>           <span class=\"n\">KC_O</span><span class=\"p\">,</span>    <span class=\"n\">KC_E</span><span class=\"p\">,</span>   <span class=\"n\">KC_U</span><span class=\"p\">,</span>   <span class=\"n\">KC_I</span><span class=\"p\">,</span>\n\n        <span class=\"n\">KC_LSFT</span><span class=\"p\">,</span>        <span class=\"n\">KC_SCLN</span><span class=\"p\">,</span> <span class=\"n\">KC_Q</span><span class=\"p\">,</span>    <span class=\"n\">KC_J</span><span class=\"p\">,</span>   <span class=\"n\">KC_K</span><span class=\"p\">,</span>   <span class=\"n\">KC_X</span><span class=\"p\">,</span>   <span class=\"n\">KC_NO</span><span class=\"p\">,</span>\n     <span class=\"n\">LT</span><span class=\"p\">(</span><span class=\"n\">SYMB</span><span class=\"p\">,</span><span class=\"n\">KC_NO</span><span class=\"p\">),</span> <span class=\"n\">LT</span><span class=\"p\">(</span><span class=\"n\">SYMB</span><span class=\"p\">,</span> <span class=\"n\">KC_ESC</span><span class=\"p\">),</span> <span class=\"n\">KC_LCTRL</span><span class=\"p\">,</span>   <span class=\"n\">KC_LALT</span><span class=\"p\">,</span>  <span class=\"n\">KC_LGUI</span><span class=\"p\">,</span>\n                                                  <span class=\"n\">KC_LALT</span><span class=\"p\">,</span>  <span class=\"n\">KC_LGUI</span><span class=\"p\">,</span>\n                                                             <span class=\"n\">KC_HOME</span><span class=\"p\">,</span>\n                                               <span class=\"n\">KC_SPC</span><span class=\"p\">,</span><span class=\"n\">KC_BSPC</span><span class=\"p\">,</span><span class=\"n\">KC_END</span><span class=\"p\">,</span>\n        <span class=\"c1\">// right hand</span>\n        <span class=\"n\">KC_7</span><span class=\"p\">,</span>        <span class=\"n\">KC_8</span><span class=\"p\">,</span>   <span class=\"n\">KC_9</span><span class=\"p\">,</span>      <span class=\"n\">KC_0</span><span class=\"p\">,</span>      <span class=\"n\">KC_PLUS</span><span class=\"p\">,</span>  <span class=\"n\">KC_EQL</span><span class=\"p\">,</span>         <span class=\"n\">KC_BSLS</span><span class=\"p\">,</span>\n        <span class=\"n\">TG</span><span class=\"p\">(</span><span class=\"n\">SYMB</span><span class=\"p\">),</span>    <span class=\"n\">KC_F</span><span class=\"p\">,</span>   <span class=\"n\">KC_G</span><span class=\"p\">,</span>      <span class=\"n\">KC_C</span><span class=\"p\">,</span>      <span class=\"n\">KC_R</span><span class=\"p\">,</span>   <span class=\"n\">KC_L</span><span class=\"p\">,</span>             <span class=\"n\">KC_SLSH</span><span class=\"p\">,</span>\n                     <span class=\"n\">KC_D</span><span class=\"p\">,</span>   <span class=\"n\">KC_H</span><span class=\"p\">,</span>      <span class=\"n\">KC_T</span><span class=\"p\">,</span>      <span class=\"n\">KC_N</span><span class=\"p\">,</span>   <span class=\"n\">LT</span><span class=\"p\">(</span><span class=\"n\">MDIA</span><span class=\"p\">,</span> <span class=\"n\">KC_S</span><span class=\"p\">),</span>   <span class=\"n\">KC_MINS</span><span class=\"p\">,</span>\n        <span class=\"n\">KC_NO</span><span class=\"p\">,</span>       <span class=\"n\">KC_B</span><span class=\"p\">,</span>   <span class=\"n\">KC_M</span><span class=\"p\">,</span>      <span class=\"n\">KC_W</span><span class=\"p\">,</span>      <span class=\"n\">KC_V</span><span class=\"p\">,</span>   <span class=\"n\">LT</span><span class=\"p\">(</span><span class=\"n\">SYMB</span><span class=\"p\">,</span> <span class=\"n\">KC_Z</span><span class=\"p\">),</span>   <span class=\"n\">KC_RSFT</span><span class=\"p\">,</span>\n                              <span class=\"n\">KC_RGUI</span><span class=\"p\">,</span>   <span class=\"n\">KC_EQL</span><span class=\"p\">,</span> <span class=\"n\">KC_LBRC</span><span class=\"p\">,</span><span class=\"n\">KC_RBRC</span><span class=\"p\">,</span>             <span class=\"n\">KC_FN1</span><span class=\"p\">,</span>\n        <span class=\"n\">KC_LALT</span><span class=\"p\">,</span>        <span class=\"n\">CTL_T</span><span class=\"p\">(</span><span class=\"n\">KC_ESC</span><span class=\"p\">),</span>\n        <span class=\"n\">KC_PGUP</span><span class=\"p\">,</span>\n        <span class=\"n\">KC_PGDN</span><span class=\"p\">,</span><span class=\"n\">KC_TAB</span><span class=\"p\">,</span> <span class=\"n\">KC_ENT</span>\n    <span class=\"p\">),</span>\n<span class=\"cm\">/* Keymap 1: Symbol Layer</span>\n<span class=\"cm\"> *</span>\n<span class=\"cm\"> * ,--------------------------------------------------.           ,--------------------------------------------------.</span>\n<span class=\"cm\"> * |    =   |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |           |   F7 |  F8  |  F9  |  F10 |  F11 |  F12 |        |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |        |   !  |   @  |   {  |   }  |   |  |      |           |      |   Up |   7  |   8  |   9  |   *  |        |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |        |   #  |   $  |   (  |   )  |   `  |------|           |------| Down |   4  |   5  |   6  |   +  |        |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |        |   %  |   ^  |   [  |   ]  |   ~  |      |           |      |   &amp;  |   1  |   2  |   3  |      |        |</span>\n<span class=\"cm\"> * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'</span>\n<span class=\"cm\"> *   |      |      |      |      |   =  |                                       |      |    . |   0  |   =  |      |</span>\n<span class=\"cm\"> *   `----------------------------------'                                       `----------------------------------'</span>\n<span class=\"cm\"> *                                        ,-------------.       ,-------------.</span>\n<span class=\"cm\"> *                                        |      |      |       |      |      |</span>\n<span class=\"cm\"> *                                 ,------|------|------|       |------+------+------.</span>\n<span class=\"cm\"> *                                 |      |      |      |       |      |      |      |</span>\n<span class=\"cm\"> *                                 |      |      |------|       |------|      |      |</span>\n<span class=\"cm\"> *                                 |      |      |      |       |      |      |      |</span>\n<span class=\"cm\"> *                                 `--------------------'       `--------------------'</span>\n<span class=\"cm\"> */</span>\n<span class=\"c1\">// SYMBOLS</span>\n<span class=\"p\">[</span><span class=\"n\">SYMB</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">KEYMAP</span><span class=\"p\">(</span>\n       <span class=\"c1\">// left hand</span>\n       <span class=\"n\">KC_EQL</span> <span class=\"p\">,</span><span class=\"n\">KC_F1</span><span class=\"p\">,</span>  <span class=\"n\">KC_F2</span><span class=\"p\">,</span>  <span class=\"n\">KC_F3</span><span class=\"p\">,</span>  <span class=\"n\">KC_F4</span><span class=\"p\">,</span>  <span class=\"n\">KC_F5</span><span class=\"p\">,</span>  <span class=\"n\">KC_F6</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_EXLM</span><span class=\"p\">,</span><span class=\"n\">KC_AT</span><span class=\"p\">,</span>  <span class=\"n\">KC_LCBR</span><span class=\"p\">,</span><span class=\"n\">KC_RCBR</span><span class=\"p\">,</span><span class=\"n\">KC_PIPE</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_HASH</span><span class=\"p\">,</span><span class=\"n\">KC_DLR</span><span class=\"p\">,</span> <span class=\"n\">KC_LPRN</span><span class=\"p\">,</span><span class=\"n\">KC_RPRN</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_PERC</span><span class=\"p\">,</span><span class=\"n\">KC_CIRC</span><span class=\"p\">,</span><span class=\"n\">KC_LBRC</span><span class=\"p\">,</span><span class=\"n\">KC_RBRC</span><span class=\"p\">,</span><span class=\"n\">KC_TILD</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                                       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                                               <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                               <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"c1\">// right hand</span>\n       <span class=\"n\">KC_F7</span><span class=\"p\">,</span>   <span class=\"n\">KC_F8</span><span class=\"p\">,</span>   <span class=\"n\">KC_F9</span><span class=\"p\">,</span>  <span class=\"n\">KC_F10</span><span class=\"p\">,</span>  <span class=\"n\">KC_F11</span><span class=\"p\">,</span>  <span class=\"n\">KC_F12</span><span class=\"p\">,</span>  <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_UP</span><span class=\"p\">,</span>   <span class=\"n\">KC_7</span><span class=\"p\">,</span>   <span class=\"n\">KC_8</span><span class=\"p\">,</span>    <span class=\"n\">KC_9</span><span class=\"p\">,</span>    <span class=\"n\">KC_ASTR</span><span class=\"p\">,</span> <span class=\"n\">KC_F12</span><span class=\"p\">,</span>\n                <span class=\"n\">KC_DOWN</span><span class=\"p\">,</span> <span class=\"n\">KC_4</span><span class=\"p\">,</span>   <span class=\"n\">KC_5</span><span class=\"p\">,</span>    <span class=\"n\">KC_6</span><span class=\"p\">,</span>    <span class=\"n\">KC_PLUS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_AMPR</span><span class=\"p\">,</span> <span class=\"n\">KC_1</span><span class=\"p\">,</span>   <span class=\"n\">KC_2</span><span class=\"p\">,</span>    <span class=\"n\">KC_3</span><span class=\"p\">,</span>    <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                         <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span><span class=\"n\">KC_DOT</span><span class=\"p\">,</span>  <span class=\"n\">KC_0</span><span class=\"p\">,</span>    <span class=\"n\">KC_EQL</span><span class=\"p\">,</span>  <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span>\n<span class=\"p\">),</span>\n<span class=\"cm\">/* Keymap 2: Media and mouse keys</span>\n<span class=\"cm\"> *</span>\n<span class=\"cm\"> * ,--------------------------------------------------.           ,--------------------------------------------------.</span>\n<span class=\"cm\"> * |  RESET |      |      |      |      |      |      |           |      |      |      |      |      |      |        |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |        |      | Lclk | MsUp | Rclk |      |      |           |      |      | PGDN |  UP  | PGUP |      |        |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |        |      |MsLeft|MsDown|MsRght|      |------|           |------| BSPC | LEFT | DOWN |RIGHT |      |  Play  |</span>\n<span class=\"cm\"> * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|</span>\n<span class=\"cm\"> * |        |      |      |      |      |      |      |           |      |      | HOME | ESC  | END  |      |        |</span>\n<span class=\"cm\"> * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'</span>\n<span class=\"cm\"> *   |      |      |      | Lclk | Rclk |                                       |VolDn |VolUp | Mute |      |      |</span>\n<span class=\"cm\"> *   `----------------------------------'                                       `----------------------------------'</span>\n<span class=\"cm\"> *                                        ,-------------.       ,-------------.</span>\n<span class=\"cm\"> *                                        |      |      |       |      |      |</span>\n<span class=\"cm\"> *                                 ,------|------|------|       |------+------+------.</span>\n<span class=\"cm\"> *                                 |      |      |      |       |      |      |Brwser|</span>\n<span class=\"cm\"> *                                 | Lclk | Rclk |------|       |------|      |Back  |</span>\n<span class=\"cm\"> *                                 |      |      |      |       |      |      |      |</span>\n<span class=\"cm\"> *                                 `--------------------'       `--------------------'</span>\n<span class=\"cm\"> */</span>\n<span class=\"c1\">// MEDIA AND MOUS</span>\n<span class=\"n\">KEYMAP</span><span class=\"p\">(</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_BTN1</span><span class=\"p\">,</span> <span class=\"n\">KC_MS_U</span><span class=\"p\">,</span> <span class=\"n\">KC_BTN2</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_BSPC</span><span class=\"p\">,</span> <span class=\"n\">KC_MS_L</span><span class=\"p\">,</span> <span class=\"n\">KC_MS_D</span><span class=\"p\">,</span> <span class=\"n\">KC_MS_R</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_ESC</span><span class=\"p\">,</span>  <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_BTN1</span><span class=\"p\">,</span> <span class=\"n\">KC_BTN2</span><span class=\"p\">,</span>\n                                           <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                                                    <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                                  <span class=\"n\">KC_BTN1</span><span class=\"p\">,</span> <span class=\"n\">KC_BTN2</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n    <span class=\"c1\">// right hand</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>  <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>  <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_PGDN</span><span class=\"p\">,</span> <span class=\"n\">KC_UP</span>  <span class=\"p\">,</span> <span class=\"n\">KC_PGUP</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                 <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_LEFT</span><span class=\"p\">,</span> <span class=\"n\">KC_DOWN</span><span class=\"p\">,</span> <span class=\"n\">KC_RGHT</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_MPLY</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>  <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_HOME</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_END</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n                          <span class=\"n\">KC_VOLD</span><span class=\"p\">,</span> <span class=\"n\">KC_VOLU</span><span class=\"p\">,</span> <span class=\"n\">KC_MUTE</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span>\n       <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_TRNS</span><span class=\"p\">,</span> <span class=\"n\">KC_RALT</span>\n<span class=\"p\">),</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">const</span> <span class=\"kt\">uint16_t</span> <span class=\"n\">PROGMEM</span> <span class=\"n\">fn_actions</span><span class=\"p\">[]</span> <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">ACTION_LAYER_TAP_TOGGLE</span><span class=\"p\">(</span><span class=\"n\">SYMB</span><span class=\"p\">)</span>                <span class=\"c1\">// FN1 - Momentary Layer 1 (Symbols)</span>\n<span class=\"p\">};</span>\n\n<span class=\"k\">const</span> <span class=\"kt\">macro_t</span> <span class=\"o\">*</span><span class=\"nf\">action_get_macro</span><span class=\"p\">(</span><span class=\"kt\">keyrecord_t</span> <span class=\"o\">*</span><span class=\"n\">record</span><span class=\"p\">,</span> <span class=\"kt\">uint8_t</span> <span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"kt\">uint8_t</span> <span class=\"n\">opt</span><span class=\"p\">)</span>\n<span class=\"p\">{</span>\n  <span class=\"c1\">// MACRODOWN only works in this function</span>\n      <span class=\"k\">switch</span><span class=\"p\">(</span><span class=\"n\">id</span><span class=\"p\">)</span> <span class=\"p\">{</span>\n        <span class=\"k\">case</span> <span class=\"mi\">0</span><span class=\"o\">:</span>\n        <span class=\"k\">if</span> <span class=\"p\">(</span><span class=\"n\">record</span><span class=\"o\">-&gt;</span><span class=\"n\">event</span><span class=\"p\">.</span><span class=\"n\">pressed</span><span class=\"p\">)</span> <span class=\"p\">{</span>\n          <span class=\"n\">register_code</span><span class=\"p\">(</span><span class=\"n\">KC_RSFT</span><span class=\"p\">);</span>\n        <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n          <span class=\"n\">unregister_code</span><span class=\"p\">(</span><span class=\"n\">KC_RSFT</span><span class=\"p\">);</span>\n        <span class=\"p\">}</span>\n        <span class=\"k\">break</span><span class=\"p\">;</span>\n      <span class=\"p\">}</span>\n    <span class=\"k\">return</span> <span class=\"n\">MACRO_NONE</span><span class=\"p\">;</span>\n<span class=\"p\">};</span>\n\n<span class=\"c1\">// Runs just one time when the keyboard initializes.</span>\n<span class=\"kt\">void</span> <span class=\"nf\">matrix_init_user</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">)</span> <span class=\"p\">{</span>\n\n<span class=\"p\">};</span>\n\n<span class=\"c1\">// Runs constantly in the background, in a loop.</span>\n<span class=\"kt\">void</span> <span class=\"nf\">matrix_scan_user</span><span class=\"p\">(</span><span class=\"kt\">void</span><span class=\"p\">)</span> <span class=\"p\">{</span>\n\n    <span class=\"kt\">uint8_t</span> <span class=\"n\">layer</span> <span class=\"o\">=</span> <span class=\"n\">biton32</span><span class=\"p\">(</span><span class=\"n\">layer_state</span><span class=\"p\">);</span>\n\n    <span class=\"n\">ergodox_board_led_off</span><span class=\"p\">();</span>\n    <span class=\"n\">ergodox_right_led_1_off</span><span class=\"p\">();</span>\n    <span class=\"n\">ergodox_right_led_2_off</span><span class=\"p\">();</span>\n    <span class=\"n\">ergodox_right_led_3_off</span><span class=\"p\">();</span>\n    <span class=\"k\">switch</span> <span class=\"p\">(</span><span class=\"n\">layer</span><span class=\"p\">)</span> <span class=\"p\">{</span>\n      <span class=\"c1\">// TODO: Make this relevant to the ErgoDox EZ.</span>\n        <span class=\"k\">case</span> <span class=\"mi\">1</span><span class=\"o\">:</span>\n            <span class=\"n\">ergodox_right_led_1_on</span><span class=\"p\">();</span>\n            <span class=\"k\">break</span><span class=\"p\">;</span>\n        <span class=\"k\">case</span> <span class=\"mi\">2</span><span class=\"o\">:</span>\n            <span class=\"n\">ergodox_right_led_2_on</span><span class=\"p\">();</span>\n            <span class=\"k\">break</span><span class=\"p\">;</span>\n        <span class=\"k\">default</span><span class=\"o\">:</span>\n            <span class=\"c1\">// none</span>\n            <span class=\"k\">break</span><span class=\"p\">;</span>\n    <span class=\"p\">}</span>\n\n<span class=\"p\">};</span>\n</pre></div></div>\n",
      Severity
      Category
      Status
      Source
      Language