Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base changes to support Halo96 (#24) #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions include/nuphy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,50 @@ class Halo75 : public NuPhy {
indicesByKeyNameMac;
};

class Halo96 : public NuPhy {
public:
Halo96(std::string dataPath, std::string requestPath, uint16_t firmware)
: NuPhy(dataPath, requestPath, firmware) {}

virtual std::string getName() { return "Halo96"; }
virtual std::vector< uint32_t > getDefaultKeymap(bool mac = false) {
return mac ? Halo96::defaultKeymapMac : Halo96::defaultKeymapWin;
}
virtual std::unordered_map< std::string, uint32_t >
getIndicesByKeyName(bool mac = false) {
return mac ? Halo96::indicesByKeyNameMac :
Halo96::indicesByKeyNameWin;
}

// TODO: Confirm proper values
virtual std::vector< uint8_t > getKeymapReportHeader(bool mac = false) {
return mac ? std::vector< uint8_t >(
{0x05, 0x84, 0xd8, 0x00, 0x00, 0x00}
) :
std::vector< uint8_t >(
{0x05, 0x84, 0xd4, 0x00, 0x00, 0x00}
);
}

// TODO: Confirm proper values
virtual std::vector< uint8_t > setKeymapReportHeader(bool mac = false) {
return mac ? std::vector< uint8_t >(
{0x06, 0x04, 0xd8, 0x00, 0x40, 0x00, 0x00, 0x00}
) :
std::vector< uint8_t >(
{0x06, 0x04, 0xd4, 0x00, 0x40, 0x00, 0x00, 0x00}
);
}
private:
static const std::vector< uint32_t > defaultKeymapWin;
static const std::unordered_map< std::string, uint32_t >
indicesByKeyNameWin;

static const std::vector< uint32_t > defaultKeymapMac;
static const std::unordered_map< std::string, uint32_t >
indicesByKeyNameMac;
};

class unsupported_keyboard : public std::runtime_error {
public:
unsupported_keyboard(const std::string &what = "")
Expand Down
3 changes: 3 additions & 0 deletions lib/nuphy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ static std::shared_ptr< NuPhy > createKeyboard(
if (name == "NuPhy Halo75") {
return std::make_shared< Halo75 >(dataPath, requestPath, firmware);
}
if (name == "NuPhy Halo96") {
return std::make_shared< Halo96 >(dataPath, requestPath, firmware);
}
return nullptr;
}

Expand Down
257 changes: 257 additions & 0 deletions res/Halo96/default_keymap_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# list defaultKeymapMac
- 0x0f000002
- 0x35000000
- 0x2b000000
- 0x39000000
- 0xe1000006
- 0xe0000006
- 0x00000002
- 0x20000002
- 0x14000000
- 0x04000000
- 0x1d000000
- 0xe2000006
- 0x01000002
- 0x21000002
- 0x1a000000
- 0x16000000
- 0x1d000002
- 0xe3000006
- 0x02000002
- 0x22000002
- 0x08000000
- 0x07000000
- 0x1e000002
- 0x91000000
- 0x03000002
- 0x23000002
- 0x15000000
- 0x2c000002
- 0x1f000002
- 0x8b000000
- 0x04000002
- 0x22000000
- 0x17000000
- 0x0d000002
- 0x25000002
- 0x2c000000
- 0x05000002
- 0x23000000
- 0x1c000000
- 0x24000002
- 0x26000002
- 0x8a000000
- 0x06000002
- 0x24000000
- 0x18000000
- 0x0d000000
- 0x10000000
- 0x90000000
- 0x07000002
- 0x25000000
- 0x0c000000
- 0x0e000000
- 0x27000002
- 0xe7000006
- 0x08000002
- 0x26000000
- 0x12000000
- 0x0f000000
- 0x28000002
- 0x00000020
- 0x09000002
- 0x27000000
- 0x13000000
- 0x33000000
- 0x29000002
- 0xe4000006
- 0x0a000002
- 0x2d000000
- 0x2f000000
- 0x34000000
- 0x87000000
- 0x88000000
- 0x0b000002
- 0x2e000000
- 0x2f000002
- 0x2d000002
- 0x64000000
- 0xe7000006
- 0x18000002
- 0x2a000000
- 0x2d000002
- 0x28000000
- 0xe5000006
- 0x12000002
- 0x4c000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x10000002
- 0x11000002
- 0x49000000
- 0x4a000000
- 0x4d000000
- 0x4b000000
- 0x4e000000
- 0x13000002
- 0x4d000000
- 0x54000000
- 0x60000000
- 0x5d000000
- 0x5a000000
- 0x62000000
- 0x4b000000
- 0x55000000
- 0x61000000
- 0x5e000000
- 0x5b000000
- 0x63000000
- 0x4e000000
- 0x56000000
- 0x57000000
- 0x85000000
- 0x58000000
- 0x00000000
- 0x00000000
- 0x55000000
- 0x61000000
- 0x5e000000
- 0x5b000000
- 0x63000000
- 0x00000000
- 0x56000000
- 0x57000000
- 0x85000000
- 0x58000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x3a000000
- 0x3b000000
- 0x3c000000
- 0x3d000000
- 0xcf000004
- 0x2000000e
- 0x40000000
- 0x41000000
- 0x42000000
- 0x43000000
- 0x44000000
- 0x45000000
- 0xe3000006
- 0x0a000000
- 0x4a000000
- 0x29000000
- 0x52000000
- 0x51000000
- 0x50000000
- 0x4f000000
- 0x1a000000
- 0x16000000
- 0x04000000
- 0x07000000
- 0x210a0000
- 0x14000000
- 0x1a000000
- 0x08000000
- 0x15000000
- 0x1b000000
- 0x06000000
- 0x19000000
- 0x1e000000
- 0x1f000000
- 0x20000000
- 0x21000000
- 0x0b000000
- 0x05000000
- 0x11000000
- 0x36000000
- 0x37000000
- 0x38000000
- 0x2d000000
- 0x2e000000
- 0x09000000
- 0x31000000
- 0x2f000000
- 0x30000000
- 0x3a000000
- 0x3b000000
- 0x3c000000
- 0x3d000000
- 0x3e000000
- 0x3f000000
- 0x40000000
- 0x41000000
- 0x42000000
- 0x43000000
- 0x44000000
- 0x45000000
- 0x0100000e
- 0x1000000e
- 0x0400000e
- 0x35000000
- 0x0001000c
- 0x0002000c
- 0x0003000b
- 0x00030012
- 0x1a000000
- 0x16000000
- 0x01000001
- 0x07000000
- 0x200a0000
- 0x0c00000e
- 0x0d00000e
- 0x0e00000e
- 0x0f00000e
- 0x1400000e
- 0x1c00000e
- 0x1d00000e
- 0x0c00000e
- 0x0d00000e
- 0x0e00000e
- 0x0f00000e
- 0x1800000e
- 0x0500000e
- 0x1e00000e
- 0x0002000d
- 0x0001000d
- 0x1700000e
- 0x2d000000
- 0x2e000000
- 0x1b00000e
- 0x1a00000e
- 0x2f000000
- 0x1900000e
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
- 0x00000000
Loading