The iMac will come with a Magic Keyboard and mouse/trackpad depending on your purchase option if ordering directly from Apple. If you don't want to use the included keyboard and it's not detected during setup, MacOS will prompt and walk you through on connecting your original Magic Keyboard(I'm assuming you're talking about the gen one that takes AA batteries).