Commit Graph

66 Commits (f52da5065a5b79a4ff36f11916006f3ed26fa689)

Author SHA1 Message Date
Stefan Dorn f52da5065a explicit modifiers 2016-06-14 09:39:45 +01:00
Stefan Dorn 9c81274348 refactor (and minor sticky bug) 2016-06-14 07:32:06 +01:00
Stefan Dorn 5dc33a30d0 refactor 2016-06-14 05:53:45 +01:00
Stefan Dorn 118f511e61 refactor 2016-06-14 05:48:02 +01:00
Stefan Dorn f5c1169af3 get rid of trans logic complete 2016-06-14 05:44:11 +01:00
Stefan Dorn 60e45f8444 refactor 2016-06-14 04:48:56 +01:00
Stefan Dorn ec2820d15b more explicit types 2016-06-14 01:49:01 +01:00
Stefan Dorn 5a651b2854 define debug_printf variant as well 2016-06-14 00:29:43 +01:00
Stefan Dorn 8748e15b59 comment 2016-06-13 23:42:34 +01:00
Stefan Dorn 79cdf4f1f3 conditional debug 2016-06-13 23:31:20 +01:00
Stefan Dorn 01be9a4d7f some basic debug messages 2016-06-13 05:25:30 +01:00
Stefan Dorn 61a8817f2e get rid of transparent keys as part of the coming sticky cleanup 2016-06-12 06:44:09 +01:00
Stefan Dorn a812590707 cleanup 2016-06-12 06:09:57 +01:00
Stefan Dorn 789169a86f refactor 2016-06-12 05:26:27 +01:00
Stefan Dorn 2f2c3d6994 refactor 2016-06-12 05:20:40 +01:00
Stefan Dorn 445e25b01b refactor so we only use as many layers as we need 2016-06-12 05:04:40 +01:00
Stefan Dorn 91e2e9f41f minor cleanup 2016-06-12 04:39:06 +01:00
Stefan Dorn a57fdf7efd refactor 2016-06-12 04:09:35 +01:00
Stefan Dorn afc7d9f87c cleanup 2016-06-12 03:55:36 +01:00
Stefan Dorn 6ec9fcbb98 simplify includes 2016-06-12 03:34:29 +01:00
Stefan Dorn 238a98d6b6 refactor 2016-06-12 02:54:30 +01:00
Stefan Dorn 1b7a4b23fd simplify makefile 2016-06-12 01:56:10 +01:00
Stefan Dorn 070b4b2caa no more warnings and automatic headers 2016-06-12 01:31:58 +01:00
Stefan Dorn ba59fee6f9 tree! 2016-06-12 00:58:43 +01:00
Stefan Dorn 90bd7c9116 almost a tree now! 2016-06-12 00:51:39 +01:00
Stefan Dorn a244e9d58d refactor 2016-06-11 22:58:12 +01:00
Stefan Dorn 0c141072da clean up header structure 2016-06-11 21:19:48 +01:00
Stefan Dorn dea913d16e less nesting 2016-06-11 20:24:42 +01:00
Stefan Dorn 3dda86dd7e remove useless headers 2016-06-11 20:13:46 +01:00
Stefan Dorn ea97f185de trust layers_top so we don't disable a layer that was already off 2016-02-13 22:08:05 +00:00
Stefan Dorn b5f88d06f4 fix latch bug 2016-02-06 14:31:54 +00:00
Stefan Dorn 8b78e8b3a4 simplify layer functions by using the keycode again 2016-02-04 15:28:11 +00:00
Stefan Dorn c88a558e8c more safety 2016-02-04 14:58:58 +00:00
Stefan Dorn 5419ab9d7a yes i can loops why 2016-02-04 14:19:14 +00:00
Stefan Dorn 37faadc8aa initialize layers to be safe 2016-02-04 14:19:06 +00:00
Stefan Dorn f9f5e4b5aa replace the stack with a flat array 2016-02-04 10:00:05 +00:00
Stefan Dorn c695c37c40 more refactor 2016-02-04 09:38:07 +00:00
Stefan Dorn e19ca08263 remove led code 2016-02-04 09:26:58 +00:00
Stefan Dorn f0da34b909 more refactor 2016-02-04 09:22:40 +00:00
Stefan Dorn 447f1fb2cb begin major refactor to replace the layer stack 2016-02-04 06:43:33 +00:00
Stefan Dorn 2159af0050 minor cleanup 2016-02-04 04:38:18 +00:00
Stefan Dorn e71b8fbeb0 simplify names 2016-02-04 04:27:48 +00:00
Ryan Prince 513b82d585 adding media keys
taken from Hasu codebase (https://github.com/tmk/tmk_keyboard) usb.c/.h
and usb_extra.c/.h, though these files only have the PJRC
copyright/license in the header
2013-04-14 00:29:47 -07:00
Ryan Prince ce4495372c caching the transparent key pressed result to fix sticky key bug
the behavior for transparent keys not affecting sticky key state was
broken because kbfun_transparent() was only getting called for key
press and not for key release because the layer for the key was cached
on keypress. By caching the transparent key press result on key press
we can ensure that the main_arg_trans_key_pressed is set correctly for
any key function called on key release
2013-04-08 11:51:01 -07:00
Ryan Prince 15a91f7b05 fixing a bug in sticky key one time state behavior, cleaning up a comment, and making braces style consistent with the rest of the code.
sticky layers in the one time state were being popped anytime
kbfun_press_release() was called, which should only happen if the key
was defined for the sticky layer, i.e. kbfun_transparent() was not the
first function mapped to that key in the topmost layer.
2013-04-08 08:46:25 -07:00
Ryan Prince f2d650b996 adding sticky key functionality
This function gives similar behavior to sticky keys for modifiers
available on most operating systems. It is considered an accessibility
feature because it alleviates the user from having to hold down
modifiers while pressing a key to produce the modified key function. It
is useful for fast touch typing because you can avoid chording motions
which both strain your hands and take your hands out of home-row
position while pressing normal alpha keys.

This function emulates the 3-state behavior which is default on OS X
and optional in Windows where the modifier cycles between
Off->Once->Locked states. This is particularly handy for symbol layers
where you typically only type one symbol before you want to return to
unmodified typing (layer 0), e.g. 'if (condition) { a = "b" + "c"; }'.
If you assign a symbol layer to a thumb key as a layer sticky cycle,
you can type the entire line of code without taking your hands out of
home row position and you do not need to toggle off the layer after
each symbol is pressed, only immediately before keying the symbol.

The exact behavior of the layer sticky cycle function is defined as
follows for each state:
1) One time down (set on key press) - The layer was not active and the
key has been pressed but not yet released. The layer is pushed in the
one time down state.
2) One time up (set on key release) - The layer was active when the
layer sticky key was released. If a key on this layer (not set to
transparent) was pressed before the key was released, the layer will be
popped. If a non-transparent key was not pressed, the layer is popped
and pushed again in the one time up state.
3) Locked (set on key press) - The layer was active and in the one time
up state when the layer sticky key was pressed again. The layer will be
popped if the function is invoked on a subsequent keypress.
2013-04-08 00:49:35 -07:00
Ben Blazak 1b41491115 fixed layer and numpad bugs - appears to work!
- rewrote the layer functions in main() (easiest way to get the to
  work.. :) )
- fixed the keymap (i had the numpad keys pushing layer 2 instead of
  layer 3)
- changed the numlock keycode.. i was using the wrong one, lol
- and some minor aesthetic changes
2012-12-03 16:19:12 -08:00
Ben Blazak 7fa2155e05 changed the way layers are handled
note: NOT YET TESTED, only compiled
2012-11-30 12:06:41 -08:00
Ben Blazak d7c1ffe0c4 removed linked lists; changed KBFUN_FUNCTION_ARGS handling
- linked lists need to be rewritten to be more memory efficient
- all kbfun functions are now of type `(void kbfun_...(void))`, and the
  arguments they need are passed via a group of global `main_arg_...`
  variables (and other `main_...` variables)
2012-08-06 15:57:23 -07:00
Ben Blazak ddade5b5dc reorganization (large one) (mostly moving files) 2012-07-31 14:48:31 -07:00