Gergely Nagy
f3c9d328ba
key_events: A way to hook into the event handling
...
This adds a new `handle_user_key_event` function, that will get called
before anything else, and can override what happens. If it returns true,
the event will not be processed further by the firmware. By default,
this function returns false, and is a no-op.
It is defined with a `weak` attribute, to let the linker know that any
other function with the same name should override his one. This makes it
possible to have another version of this function in a firmware Sketch,
and override the behaviour, to extend the event handling.
This is the foundation that allows it to use external libraries, and tap
into the firmware's event handler, to add new stuff. (We can already
hook into the main loop by changing the top `loop` function in the
Sketch)
This addresses #21 for the most part.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Jesse Vincent
25f10397fe
Update copyright year
8 years ago
Jesse Vincent
751fa19741
Delay 100ms when starting up. That's long enough to let the ATTiny get
...
past the bootloader delay
8 years ago
Jesse Vincent
446036d158
Undo numist's nicer code layout so we can build as a 'regular' arduino sketch
8 years ago
Scott Perry
51eba85906
Move firmware into /source, deps as submodules in /libraries
8 years ago
Jesse Vincent
61798be38e
HACK: Invert the order of "write to i2c" and "read from i2c"
...
HACK: Invert the order of "write to i2c" and "read from i2c" because we're
seeing a weird phantom issue where after writing LED data to the ATTiny,
and reading immediately, we get back its own address, a 0 byte and then
garbage
I2C,Setup Read to [0xB1] + ACK
I2C,0xB1 + ACK
I2C,0x00 + ACK
I2C,0xFF + ACK
I2C,0xFF + ACK
I2C,0xFF + NAK
It appears that this has ~nothing to do with the ATTiny's firmware,
but I've been wrong before
9 years ago
Jesse Vincent
feebc13dca
Move keymap data structures out of the toplevel sketch
9 years ago
Jesse Vincent
3c223d4b3d
better implementation/general separation for keyswitch matrix
9 years ago
Jesse Vincent
ebf274db37
whitespace
9 years ago
Jesse Vincent
7cd1286810
simplify the 'setup' API for the hardware
9 years ago
Jesse Vincent
7257d2af2a
Initialize our AbsoluteMouse device in the init routine
9 years ago
Jesse Vincent
9bb0e64f4a
move "scan_matrix" into the implementation specific class, since it looks like it'll be very different between beta and production
9 years ago
Jesse Vincent
3281020304
First pass at turning the implementation side into a class
9 years ago
Jesse Vincent
79dfa290c7
Cleaner separation for our 'Storage' class
9 years ago
Jesse Vincent
13954d0165
Rename KeyboardStorage to Storage
9 years ago
Jesse Vincent
da88056a9c
convert LEDControl to a more real class
9 years ago
Jesse Vincent
054cd7560b
Rename 'HID-Project' to 'KeyboardioHID'
9 years ago
Jesse Vincent
ae33e7aef2
astyle
9 years ago
Jesse Vincent
5545283db1
First pass at extracting key event functions to their own source files
9 years ago
Jesse Vincent
4d2c9ddff8
remove a pointless comment
9 years ago
Jesse Vincent
532782fb14
Tiny logic cleanup
9 years ago
Jesse Vincent
a88bb5f32c
We're already checking switch_to_keymap in caller
9 years ago
Jesse Vincent
921e700d9f
tiny logic fix
9 years ago
Jesse Vincent
5d7139c8f0
move handle_mouse_key_event next to other key event handling
9 years ago
Jesse Vincent
605f0039ea
rename update_leds
9 years ago
Jesse Vincent
146b69997b
rename next_led_mode
9 years ago
Jesse Vincent
88d220094c
rename the LED boot animation function
9 years ago
Jesse Vincent
84ac0781b4
Add support for composite keys with ctrl, alt or gui held
9 years ago
Jesse Vincent
8961aeb168
make leds_setup match naming pins_setup
9 years ago
Jesse Vincent
abb9f924db
slightly refactor matrix scanning loop
9 years ago
Jesse Vincent
52b8d216cc
Broken initial implementation of passing the previous key matrix state by reference
9 years ago
Jesse Vincent
73caeff437
Simplify mouse movement code
9 years ago
Jesse Vincent
4dc59ecf94
the function moves the mouse
9 years ago
Jesse Vincent
d5ebc7c5ad
Make the LED update API a bit more flexible
9 years ago
Jesse Vincent
679d65d6b8
rename the LED class singleton
9 years ago
Jesse Vincent
da7312635b
Move code that's not actually part of the matrix scanner out of the matrix scanning function
9 years ago
Jesse Vincent
7da94a5690
A bit of renaming for consistency
9 years ago
Jesse Vincent
f53f912cb2
We're not using the serial connection right now.
9 years ago
Jesse Vincent
80f2182e12
remove comment and commented out code
9 years ago
Jesse Vincent
accafbf755
reorder some functions
9 years ago
Jesse Vincent
181b84a572
astyle
9 years ago
Jesse Vincent
91e256a913
move the set_keymap conditional outside the set_keymap function
9 years ago
Jesse Vincent
9dfec10ecc
Remove old debugging output
9 years ago
Jesse Vincent
16411878aa
First pass of making led_control into a class
9 years ago
Jesse Vincent
956c974aed
Trivial first library wrapper for the storage functions
9 years ago
Jesse Vincent
5924a25cda
remove an outdated comment
9 years ago
Jesse Vincent
fb5446c71d
The method didn't send key events, it handled them
9 years ago
Jesse Vincent
02798e4b1c
remove a layer of indirection
...
..that I may want to add back later
9 years ago
Jesse Vincent
9e1670757e
remove comments that no longer apply
9 years ago
Jesse Vincent
619c4da1ad
remove unused includes
9 years ago