Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed space bar bug #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions rokutyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,31 @@
import subprocess

# Moves the cursor back to the a position
def gethome(up,left,count_r, count_c):
def gethome(message,up,left,count_r, count_c):
# Sends cursor home if last postion was a space
if (message[-1] == ' '):
os.system(left)
for n in range(0,6):
os.system(up)
return
else:
for n in range(0,count_r):
os.system(left)
for n in range(0,count_c):
os.system(up)
return

for n in range(0,count_r):
# If user didnt put a space at the end funciton puts it for them to set up the next enquiry
def getspace(message,down,select,right,left,up):
if (message[-1] != ' '):
for n in range(0,6):
os.system(down)
os.system(right)
os.system(select)
os.system(left)
for n in range(0,count_c):
os.system(up)
return
for n in range(0,6):
os.system(up)

# Moves the cursor to correct row
def leftright(row_mov,left,right):
Expand Down Expand Up @@ -90,8 +108,10 @@ def printer(message,up,down,right,left,select):

# Updates position of cursor to be correct for the next letter
cur_pos = active
gethome(up,left,count_r, count_c)


gethome(message,up,left,count_r, count_c)
getspace(message,down,select,right,left,up)

return()

# Main Function
Expand Down Expand Up @@ -149,12 +169,13 @@ def main():
while(1):
# Get message text to be output
message = str(input("\nEnter a message: ").lower())

#message = message.ljust(len(message)+1, ' ')

# Run printer methods
printer(message,up,down,right,left,select)

return()

# Calls the main() function
if __name__ == '__main__':
main()
main()