aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNick Coutsos <[email protected]>2022-04-25 00:10:31 -0400
committerNick Coutsos <[email protected]>2022-04-25 00:10:31 -0400
commitae019b2589bc63161efacdbfa8b8b2bb640aec94 (patch)
treeeda3d20244af84ad3e3e4643ea3b3388bf6a050b
parent1d9f7ab75dbfa9f6c8c60efdecc134387fb6e0ec (diff)
downloadkeymap-editor-ae019b2589bc63161efacdbfa8b8b2bb640aec94.tar.gz
keymap-editor-ae019b2589bc63161efacdbfa8b8b2bb640aec94.zip
Fix search target for layer bindings
-rw-r--r--app/src/Keyboard/Keyboard.js2
-rw-r--r--app/src/Keyboard/Keys/Key.js8
2 files changed, 3 insertions, 7 deletions
diff --git a/app/src/Keyboard/Keyboard.js b/app/src/Keyboard/Keyboard.js
index 065072f..b1df7fa 100644
--- a/app/src/Keyboard/Keyboard.js
+++ b/app/src/Keyboard/Keyboard.js
@@ -138,7 +138,7 @@ function Keyboard(props) {
onRenameLayer={handleRenameLayer}
onDeleteLayer={handleDeleteLayer}
/>
- <SearchContext.Provider value={{ getSearchTargets }}>
+ <SearchContext.Provider value={{ getSearchTargets, sources }}>
<div style={getWrapperStyle()}>
{isReady() && (
<KeyboardLayout
diff --git a/app/src/Keyboard/Keys/Key.js b/app/src/Keyboard/Keys/Key.js
index 7374eab..8f4928e 100644
--- a/app/src/Keyboard/Keys/Key.js
+++ b/app/src/Keyboard/Keys/Key.js
@@ -64,14 +64,10 @@ function createPromptMessage(param) {
}
export default function Key(props) {
- const { keycodes, behaviours } = useContext(DefinitionsContext)
- const { getSearchTargets } = useContext(SearchContext)
+ const { behaviours } = useContext(DefinitionsContext)
+ const { getSearchTargets, sources } = useContext(SearchContext)
const { position, rotation, size } = props
const { label, value, params, onUpdate } = props
- const sources = {
- behaviours: behaviours.indexed,
- code: keycodes.indexed
- }
const [editing, setEditing] = useState(null)
const bind = value