aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/common/mousekey.h
blob: 9338d0af7799de060c1f67312ad5dae862eae6be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
Copyright 2011 Jun Wako <wakojun@gmail.com>

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 <http://www.gnu.org/licenses/>.
*/

#ifndef MOUSEKEY_H
#define  MOUSEKEY_H

#include <stdbool.h>
#include "host.h"


/* max value on report descriptor */
#ifndef MOUSEKEY_MOVE_MAX
    #define MOUSEKEY_MOVE_MAX       127
#elif MOUSEKEY_MOVE_MAX > 127
    #error MOUSEKEY_MOVE_MAX needs to be smaller than 127
#endif

#ifndef MOUSEKEY_WHEEL_MAX
    #define MOUSEKEY_WHEEL_MAX      127
#elif MOUSEKEY_WHEEL_MAX > 127
    #error MOUSEKEY_WHEEL_MAX needs to be smaller than 127
#endif

#ifndef MOUSEKEY_MOVE_DELTA
#define MOUSEKEY_MOVE_DELTA     5
#endif
#ifndef MOUSEKEY_WHEEL_DELTA
#define MOUSEKEY_WHEEL_DELTA    1
#endif
#ifndef MOUSEKEY_DELAY
#define MOUSEKEY_DELAY 300
#endif
#ifndef MOUSEKEY_INTERVAL
#define MOUSEKEY_INTERVAL 50
#endif
#ifndef MOUSEKEY_MAX_SPEED
#define MOUSEKEY_MAX_SPEED 10
#endif
#ifndef MOUSEKEY_TIME_TO_MAX
#define MOUSEKEY_TIME_TO_MAX 20
#endif
#ifndef MOUSEKEY_WHEEL_MAX_SPEED
#define MOUSEKEY_WHEEL_MAX_SPEED 8
#endif
#ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
#endif


#ifdef __cplusplus
extern "C" {
#endif

extern uint8_t mk_delay;
extern uint8_t mk_interval;
extern uint8_t mk_max_speed;
extern uint8_t mk_time_to_max;
extern uint8_t mk_wheel_max_speed;
extern uint8_t mk_wheel_time_to_max;


void mousekey_task(void);
void mousekey_on(uint8_t code);
void mousekey_off(uint8_t code);
void mousekey_clear(void);
void mousekey_send(void);

#ifdef __cplusplus
}
#endif

#endif
It's also nice, in that you don't have to jump to another window. 1. Click <kbd><kbd>File</kbd> > <kbd>Preferences ></kbd> > <kbd>Settings</kbd> </kbd> 2. Click on the <kbd>{}</kbd> button, in the top right to open the `settings.json` file. 3. Set the file's content to: ```json { "terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe", "terminal.integrated.env.windows": { "MSYSTEM": "MINGW64", "CHERE_INVOKING": "1" }, "terminal.integrated.shellArgs.windows": [ "--login" ], "terminal.integrated.cursorStyle": "line" } ``` If there are settings here already, then just add everything between the first and last curly brackets. ?> If you installed MSYS2 to a different folder, then you'll need to change the path for `terminal.integrated.shell.windows` to the correct path for your system. 4. Hit Ctrl-` (grave) to bring up the terminal. This should start the terminal in the workspace's folder (so the `qmk_firmware` folder), and then you can compile your keyboard. ## Every other Operating System 1. Head to [VS Code](https://code.visualstudio.com/) and download the installer 2. Run the installer 3. That's it No, really, that's it. The paths needed are already included when installing the packages, and it is much better about detecting the current workspace files and parsing them for IntelliSense. ## Plugins There are a number of extensions that you may want to install: * [Git Extension Pack](https://marketplace.visualstudio.com/items?itemName=donjayamanne.git-extension-pack) - This installs a bunch of Git related tools that may make using Git with QMK Firmware easier. * [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) - _[Optional]_ - Helps to keep the code to the QMK Coding Conventions. * [Bracket Pair Colorizer 2](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2) - _[Optional]_ - This color codes the brackets in your code, to make it easier to reference nested code. * [Github Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) - _[Optional]_ - Makes the markdown preview in VS Code more like GitHub's. * [VS Live Share Extension Pack](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack) - _[Optional]_ - This extension allows somebody else to access your workspace (or you to access somebody else's workspace) and help out. This is great if you're having issues and need some help from somebody. * [VIM Keymap](https://marketplace.visualstudio.com/items?itemName=GiuseppeCesarano.vim-keymap) - _[Optional]_ - For those that prefer VIM style keybindings. There are other options for this, too. * [Travis CI Status](https://marketplace.visualstudio.com/items?itemName=felixrieseberg.vsc-travis-ci-status) - _[Optional]_ - This shows the current Travis CI status, if you have it set up. Restart once you've installed any extensions # Configure VS Code for QMK 1. Click <kbd><kbd>File</kbd> > <kbd>Open Folder</kbd></kbd> 2. Open the QMK Firmware folder that you cloned from GitHub. 3. Click <kbd><kbd>File</kbd> > <kbd>Save Workspace As...</kbd></kbd> And now you're ready to code QMK Firmware in VS Code