Skip to content

Commit

Permalink
add blender shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
kolibril13 committed Mar 28, 2024
1 parent fefd6d5 commit 4dfa36f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ import { useState, useEffect } from "react";
import { Tldraw, createShapeId } from "tldraw";
import "tldraw/tldraw.css";

const overrides = {
//[a]
actions(_editor, actions) {
actions["delete"].kbd = "x";
return actions;
},
//[b]
tools(_editor, tools) {
tools["hand"].kbd = "g";
tools["select"].kbd = "tab";
tools["draw"].kbd = "tab";
return tools;
},
};

export default function App() {
// State for the x-coordinate of the rectangle
const [xCoordinate, setXCoordinate] = useState(350);
Expand Down Expand Up @@ -110,7 +125,7 @@ export default function App() {
top: "50px",
}}
>
<Tldraw onMount={handleMount}></Tldraw>
<Tldraw onMount={handleMount} overrides={overrides}></Tldraw>
</div>
</>
);
Expand Down

0 comments on commit 4dfa36f

Please sign in to comment.