Comments (7)
We can add a blacklight update function after matrix.wait()
, and add a timeout to matrix.wait
matrix.wait(10)
# change backlight
backlight.update()
Another way is moving backlight into circuitpython firmware. Use timer's callback to update the backlight. It will be better, but will take more time to implement.
from python-keyboard.
I have been doing some initial playing around with this. Initially just playing around with adding the lines
self.backlight.pixel(key, 0xFF, 0x00, 0x00)
self.backlight.update()
at this line
python-keyboard/keyboard/__init__.py
Line 430 in 8d184d9
I'm having some weird behavior depending on where I put something like self.backlight.update()
. If I put it right after the wait like you said, I get some nasty errors that I don't quite understand yet and cause the keyboard not to run. Do you have any idea why putting the update function or pixel setting in different locations in that function causes it to error out?
from python-keyboard.
The 7th bit of key
is 1
when the key is released. Should change self.backlight.pixel(key, 0xFF, 0x00, 0x00)
to self.backlight.pixel(key & 0x7F, 0xFF, 0x00, 0x00)
from python-keyboard.
Do you mean what was happening in this line? Or should I be doing it again?
python-keyboard/keyboard/__init__.py
Line 425 in 8d184d9
from python-keyboard.
Oh, not need to do it again. I don't see any difference when putting self.backlight.update()
in different locations.
I tried to replace the get
function to:
def get(self):
key = self.matrix.get()
if key & 0x80 == 0:
self.heatmap[key] += 1
self.backlight.pixel(key, 0, 0x80, 0)
else:
self.backlight.pixel(key & 0x7F, 0, 0, 0)
self.backlight.update()
return key
Do you mind to create a branch to share your code? So I can check it.
from python-keyboard.
It turned out to be another issue. I was able to fix it. I am currently using something similar to what you put except a check to see if it's the spacebar and in that case light up all 3 LEDs (56, 61, 62) and it's working great and the latency while it went up isn't noticeable during use (7 nanoseconds)
from python-keyboard.
I just opened up a PR with the current state of this development (#10)
from python-keyboard.
Related Issues (20)
- Feature request: Custom RGB modes tied to layers HOT 2
- Shuttingdown the Keyboard HOT 3
- Layer tap key does not repeat HOT 1
- Feature Request: Charging Indicators HOT 2
- Issue switching to lower layers HOT 5
- AltGr is invoking Left Ctrl, and AltGr HOT 11
- Non-functional D and . Keys HOT 5
- Latest code.py Does Not Work HOT 1
- Expose I2C Bus HOT 1
- Power Consumption HOT 1
- matrix.wait doesn't block? HOT 3
- battery not charging HOT 15
- feature request: connect to BLE mouse HOT 1
- How long does it take to flash new firmware? HOT 1
- LAYER_TOGGLE throws exception HOT 1
- Supported MCU's
- Stops responding on Windows 10
- Bluetooth much more responsive when on low battery. HOT 1
- upgrade CircuitPython HOT 7
- Keyboard Crashing Windows Inputs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-keyboard.