Here's an approach to present the user with an entire matrix of placeholders at once, which should make it easier to quickly enter a matrix without getting confused about which entry is being edited:

{m, n} = {2, 3};
DialogInput[{
"Enter matrix:",
Style[
Framed[
MatrixForm@Table[
Style[
RawBoxes@TagBox["\[Placeholder]", # &, BoxID -> "Placeholder"],
Deployed -> False
],
m, n
],
Background -> White,
BaseStyle -> {FontSize -> 12},
ImageSize -> Full,
FrameStyle -> LightGray
],
Editable -> True
],
ChoiceButtons[{
DialogReturn[
ToExpression@
FirstCase[NotebookRead@Cells[][[2]],
FrameBox[g_, ___] :> g, $Failed, All]]
}]},
WindowSize -> {400, FitAll},
ShowCursorTracker -> False,
WindowTitle -> None,
Selectable -> True,
Initialization :> Function[MathLink`CallFrontEnd[
FrontEnd`BoxReferenceFind[
FE`BoxReference[
#,
{{"Placeholder"}},
FE`BoxOffset -> {FE`BoxChild[1]},
FE`SearchStart -> "StartFromBeginning"
]
]
]
]
]
Notes:
- The
Selectable->True
on the notebook and Deployed->False
on the individual placeholders ensures that only the placeholders can be selected and edited.
- The
TagBox[...,BoxID->...]
and FrontEnd`BoxReferenceFind
trick is needed to select the first placeholder upon showing the notebook (this is based on what DialogInput
does internally) - a normal NotebookFind
did not work for me.
- The
ToExpression[...]
part in the ChoiceButtons
part selects the correct part of the notebook, and converts the entire matrix as an expression, making it usable for the rest of the code.
- Most of the rest is styling, which can be adapted as desired. I based the options on those from
DialogInput
and tried to mimic the style of an InputField
for the matrix input.