24 Sep 2023 |
elegantbeef#0 | apple users can kick rocks | 02:55:09 |
elegantbeef#0 | Alternatively have it be KControl and have a const KCommand = KControl | 02:55:25 |
.elcritch | haha, except I'm on mac - and command is better than control for GUI stuff 😛 | 02:55:58 |
elegantbeef#0 | I mean more keyboards say 'ctrl' than 'command' | 02:56:29 |
elegantbeef#0 | So uhhh fite me | 02:56:31 |
.elcritch | not a const, it'd be nice to use "command" key on linux -- which is why I made if configurable | 02:56:32 |
.elcritch | * not a const, it'd be nice to use "menu" key on linux as command -- which is why I made if configurable | 02:57:17 |
elegantbeef#0 | This is some cursed code | 02:58:02 |
elegantbeef#0 | proc toModifier*(buttons: UiButtonView): ModifierKeys =
when not defined(release):
var count = 0
for modifier, mappedButtons in keyConfig:
if (mappedButtons * buttons).len > 0:
result = modifier
when not defined(release):
inc count
when not defined(release):
assert count == 1 | 02:58:53 |
.elcritch | I think it's easier if you do some form of:
let ck = keys * ModifierButtons
if ck == {} and keyConfig[commands] == {}: .... | 03:01:58 |
.elcritch | Oh wait, nvm I see the len there | 03:02:35 |
.elcritch | Hmmm, maybe a set[ModifierKeys] ? The UiButtons are copied from Windy, which don't have generic "KeyControl", just the left / right ones | 03:03:28 |
elegantbeef#0 | Eh I now realise that you had a custom == so this was all pointless really | 03:04:18 |
.elcritch | Yah but it only handled one modifer - not sets of modifier which would be a nicer way to do that probably | 03:05:27 |
elegantbeef#0 | Probably in the future | 03:05:52 |
.elcritch | Also, theres ModifierButtons | 03:05:55 |
.elcritch | Hmmm, my few takes to let widgets decide where child elements "live" failed - it screwed lots of things. The second sorta worked, but ended up deleting and rebuilding child-nodes on every refresh :/ Messing with the parent / child relationship is hard! | 03:13:18 |
.elcritch | Think it's time to go to the movie theater watch a movie and drink a beer! 😎 | 03:14:02 |
Elegantbeef | Have fun, I'm taking a break from this text editor | 03:14:34 |
.elcritch | lol, don't blame yah. thanks for hacking on it though, definitely need to bone up the text handling | 03:17:10 |
Elegantbeef | I'll probably have a PR sometime | 03:17:25 |
.elcritch | sweet! | 03:17:52 |
alendrik | I meant B-Trees as in balanced trees. I have the general idea of it, but im struggling to understand the “balancing” operation. | 03:28:41 |
Elegantbeef | I've not looked at the algorithims for it, but what's holding you up? | 04:04:51 |
| saiiiniii#0 changed their profile picture. | 04:07:07 |
alendrik | I'm not really sure how the "balancing" operation works. There are some restrictions on how many leafs/sub-nodes a node can have and some operation is done to split and balance | 05:38:00 |
alendrik | However, I'm not really sure how to conceptualize it. Yeah, I could probably rip it off somewhere else, but I want to get a better understanding atleast. | 05:38:29 |
alendrik | I received the comment that I should just use a DB, but I don't want to add anything that isn't particularly needed. | 05:39:16 |
Elegantbeef | .elcritch so looking at it again now, and i've disabled all the logic for backspace but it moves the selection to the right | 05:58:52 |
Elegantbeef | Oh keyInput fires for sub 20 characters | 06:02:37 |