For instructions of how to change a keyboard layout see here.
Once downloaded and installed the following keyboard layouts make it possible to enter the diacritical letters ā, s̄ and z̄ directly:
This layout should be associated with English keyboards (EN). It is the regular US keyboard layout with the following differences:
[ / { is replaced by ā / Ā
] / } is replaced by s̄ / S̄
\ / | is replaced by z̄ / Z̄
To access the keys you need to hold the Alt Gr key followed by any of those keys.

This layout should be associated with English keyboards (EN). It is the regular UK keyboard layout with the following differences:
[ / { is replaced by ā / Ā
] / } is replaced by s̄ / S̄
\ / | is replaced by z̄ / Z̄
To access the keys you need to hold the Alt Gr key followed by any of those keys.
This layout should be associated with German keyboards (DE). It is the regular German keyboard layout with the following differences:
ä / Ä is replaced by ā / Ā
ö / Ö is replaced by s̄ / S̄
ü / Ü is replaced by z̄ / Z̄
This layout should be associated with Swedish keyboards (SE). It is the regular Swedish keyboard layout with the following differences:
ä/Ä is replaced by ā / Ā
ö/Ö is replaced by s̄ / S̄
å/Å is replaced by z̄ / Z̄
Smartphones
Using a special app you can also create your own keyboard layout for your smartphone. Here is an example created with xKeyboard for iphone based on German keyboard layout:
