That is possible under Mac if you use the "Arabic QWERTY" keyboard. See this link for instructions
http://katibapp.com/help/arabic-on-mac/#learnersofarabicwill...Additionally, you can use the "Keyboard Viewer" when Arabic is selected as a keyboard layout and hold shift. This will show you which keys render diacritics.