mirror of https://github.com/OrbTools/OrbBind
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
523 B
Go
29 lines
523 B
Go
package orbweaver
|
|
|
|
import (
|
|
"encoding/binary"
|
|
|
|
"fyne.io/fyne"
|
|
)
|
|
|
|
//PKM format for altering the keymap
|
|
type PKM struct {
|
|
MIP [20]uint16
|
|
SIP [6]uint16
|
|
COL [3]byte
|
|
}
|
|
|
|
//SaveIntoKeymap saves an orb
|
|
func SaveIntoKeymap(mapped *PKM, file fyne.URIWriteCloser) {
|
|
binary.Write(file, binary.LittleEndian, mapped)
|
|
file.Close()
|
|
}
|
|
|
|
//LoadFile loads an orb
|
|
func LoadFile(file fyne.URIReadCloser) *PKM {
|
|
mapped := new(PKM)
|
|
binary.Read(file, binary.LittleEndian, mapped)
|
|
file.Close()
|
|
return mapped
|
|
}
|