···134134 const result = try parser.parse(buf[start..n]);
135135 start = result.n;
136136 // TODO: if we get 0 byte read, copy the remaining bytes to the
137137- // beginning of the buffer and read mmore?
137137+ // beginning of the buffer and read mmore? this should only happen
138138+ // if we are in the middle of a grapheme at and filled our
139139+ // buffer. Probably can happen on large pastes so needs to be
140140+ // implemented but low priority
138141139142 const event = result.event orelse continue;
140143 switch (event) {
···143146 vx.postEvent(.{ .key_press = key });
144147 }
145148 },
146146- .focus_in => {},
147147- .focus_out => {},
149149+ .focus_in => {
150150+ if (@hasField(EventType, "focus_in")) {
151151+ vx.postEvent(.focus_in);
152152+ }
153153+ },
154154+ .focus_out => {
155155+ if (@hasField(EventType, "focus_out")) {
156156+ vx.postEvent(.focus_out);
157157+ }
158158+ },
159159+ .paste_start => {
160160+ if (@hasField(EventType, "paste_start")) {
161161+ vx.postEvent(.paste_start);
162162+ }
163163+ },
164164+ .paste_end => {
165165+ if (@hasField(EventType, "paste_end")) {
166166+ vx.postEvent(.paste_end);
167167+ }
168168+ },
148169 }
149170 }
150171 }