MCPcopy
hub / github.com/mmulet/term.everything / parse_length_2

Function parse_length_2

termeverything/ConvertKeycodeToXbdCode.go:185–205  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

183}
184
185func parse_length_2(data []byte) []XkbdCode {
186 if len(data) < 2 {
187 return nil
188 }
189 if data[0] == 27 {
190 out := KeycodeSingleCodes(int(data[1]))
191 if out == nil {
192 return nil
193 }
194 out.Modifiers |= ModAlt
195 return []XkbdCode{out}
196 }
197 out := make([]XkbdCode, 0, 2)
198 if out1 := KeycodeSingleCodes(int(data[0])); out1 != nil {
199 out = append(out, out1)
200 }
201 if out2 := KeycodeSingleCodes(int(data[1])); out2 != nil {
202 out = append(out, out2)
203 }
204 return out
205}
206
207func parse_length_3(data []byte) []XkbdCode {
208 if len(data) < 3 {

Callers 2

ConvertKeycodeToXbdCodeFunction · 0.85
parse_length_3Function · 0.85

Calls 1

KeycodeSingleCodesFunction · 0.85

Tested by

no test coverage detected