Compare commits

..

3 commits

Author SHA1 Message Date
1ddbfc7b5c Use the correct modifier independently of the layer 2021-12-23 13:36:03 -03:00
c9b5ce175c Revert "Revert "Reimplement modifiers as bit operations""
This reverts commit 49e2eb410b.
2021-12-23 13:21:54 -03:00
49e2eb410b Revert "Reimplement modifiers as bit operations"
This reverts commit 112ee7b90a.
2021-12-23 11:49:01 -03:00
2 changed files with 7 additions and 6 deletions

View file

@ -297,12 +297,12 @@
(press-key-aux keycode key)))
;; Record that a given key being released resulted in a modifier release.
(define (release-modifier keycode key n)
(define (release-modifier modifier key n)
(if (= (or (vector-ref keys-for-modifiers n) (- 0 1)) key)
(begin
(set! modifiers (^ modifiers (unmodify keycode)))
(set! modifiers (^ modifiers modifier))
(vector-set! keys-for-modifiers n #f))
(and (< n 7) (release-modifier keycode key (+ n 1)))))
(and (< n 7) (release-modifier modifier key (+ n 1)))))
;; Record a key release, clearing it out of the press tracking data.
(define (release-key key)
@ -320,9 +320,7 @@
(vector-set! keys-for-frame slot #f))
#f)
(if modifier-slot
(begin
(release-modifier keycode key 0)
(release-key key))
(release-modifier (call-c-func "mathpow" 2 modifier-slot) key 0)
#f)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Send USB

View file

@ -33,6 +33,9 @@
int16_t mathlog2(int x) {
return round(log(x)/log(2));
}
int16_t mathpow(int x, int y) {
return round(pow(x, y));
}
/**************************************************************************
*