Compare commits
3 commits
112ee7b90a
...
1ddbfc7b5c
Author | SHA1 | Date | |
---|---|---|---|
1ddbfc7b5c | |||
c9b5ce175c | |||
49e2eb410b |
2 changed files with 7 additions and 6 deletions
10
menelaus.scm
10
menelaus.scm
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue