+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Keyboard app help

  1. #1
    Wire Noob Seraphis's Avatar
    Join Date
    Mar 2007
    Posts
    24

    Default

    Ok, so I was working on some CPU code to make a simple keyboard out of buttons and have it type letters out on the console.

    The way I have it working, it' really bulky code-wise, is that I have each letter under it's own call procedure. There's also a set of buttons with values 1-9 (a-i until I get it working, then a-z)

    It works like a charm, except for the fact that every letter just replaces the previous...

    SO... my question is, how do you get the letter to move over to the next space before putting it down.


    Heres a sample out of my code, it basically just repeats for all the letters.

    Code:
    DATA;
    messagea:**//macro a
    db 'A ',0;
    messageb:**//macro b
    db 'B ',0;
    WriteStringa:**//draw
    **mov eax,65536;
    **AWriteLoopa:
    ****cmp #esi,0;
    ****je AEnda;
    ****mov #eax,#esi;
    ****inc eax;
    ****mov #eax,edx;
    ****inc eax;
    ****inc esi;
    **jmp AWriteLoopa;
    **AEnda:
    **ret
    CODE;
    **mainloop:
    **mov ecx,port0;
    **cmp ecx,1; // if port 0 = 1
    **je drawa;**// then draw A (goto label)
    **cmp ecx,2;
    **je drawb;
    **jmp mainloop;
    drawa: // call the Draw A procedure
    **mov esi,messagea;
    **mov edx,000999;
    **call WriteStringa;
    **jmp mainloop;
    drawb:
    **mov esi,messageb;
    **mov edx,000999;
    **call WriteStringa;
    **jmp mainloop;

  2. #2
    Wire Amateur conman420's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    98

    Default

    You need to tell the console screen to add one to the X coord after a letter is drawn.

  3. #3
    Wire Noob Seraphis's Avatar
    Join Date
    Mar 2007
    Posts
    24

    Default

    ah, I'll give that a try

  4. #4
    Wire Noob Seraphis's Avatar
    Join Date
    Mar 2007
    Posts
    24

    Default

    That did nothing... lol The console screen is linked through the membus. I had a variable increase by 1 every time a keyboard key was pressed, and then linked that to the Console's X coord.

  5. #5
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Increase them by 2, because format of console screen is even bytes = character, odd = parameter
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  6. #6
    Wire Amateur conman420's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    98

    Default

    Is anyone working on an actual keyboard stool? It would work by binding all your keys on the keyboard to the gmod keyboard. If you press E on it. Or if you walk up to it? say if you are 20 units away from the keyboard it binds all your keys.

  7. #7
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Yes, I am working on it
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  8. #8
    Wire Amateur Razara's Avatar
    Join Date
    Feb 2007
    Location
    Michigan, USA
    Posts
    64

    Default

    i just tried the keyboard, pressed E and now my game is stuck in the keyboard mode and i can't seem to get out of it. How does one exit the keyboard?

  9. #9
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Code:
    exec config_default
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  10. #10
    Wire Amateur TomatoSoup's Avatar
    Join Date
    Mar 2007
    Posts
    72

    Default

    Code:
    exec config_default
    [/b]
    Why not make it so pressing like... Enter, or Tab, leaves the keyboard?

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. E2 keyboard??
    By oenmaster in forum Expression 2 Discussion & Help
    Replies: 10
    Last Post: 01-03-2009, 01:57 AM
  2. Keyboard Keys
    By Mesh in forum Ideas & Suggestions
    Replies: 11
    Last Post: 06-25-2008, 05:39 AM
  3. Keyboard Changes
    By Jaded Misanthrope in forum Ideas & Suggestions
    Replies: 0
    Last Post: 04-26-2008, 12:20 PM
  4. Keyboard
    By magmaknight in forum Finished contraptions
    Replies: 2
    Last Post: 08-06-2007, 03:29 PM
  5. Keyboard
    By Jowel in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 05-04-2007, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots