• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login

My script for game manual instructions reader

Scheduled Pinned Locked Moved Ideas and Development
ebooksmanualinstruction
4 Posts 2 Posters 1.7k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    col
    last edited by col 28 Jul 2017, 21:42

    Hello, I've written very simple script for reading game manuals.

    It works with gamepad as joy2key maps gamepad to the keyboard.

    Just:

    • Create folder path "/home/pi/RetroPie/retropiemenu/Game Manuals/$SYSTEM_NAME/"
    • Inside this folder create a) subfolder with name of the game "/home/pi/RetroPie/retropiemenu/Game Manuals/$SYSTEM_NAME/$GAME_NAME"
    • Put all manual images inside $GAME_NAME folder
    • Name the following script as "$GAME_NAME.sh" and put following code inside (example for "Atari 2600" system and game called "Adventure"). Place this script in the $SYSTEM_NAME folder
    • Once it's done you will find new Option in EmulationStation menu, in settings, called "Game Manuals".

    SCRIPT:

    #!/bin/bash
    
    sudo killall joy2key.py
    #/opt/retropie/supplementary/runcommand/joy2key.py /dev/input/js0 left right up down A B ? X Y ? L1 R1 L2 R2 select start ? lAnalog rAnalog  &
    /opt/retropie/supplementary/runcommand/joy2key.py /dev/input/js0 kcub1 kcuf1 kcuu1 kcud1 0x2b 0x2d 0x00 0x61 0x70 0x00 0x6b 0x6a 0x72 0x6C 0x71 0x68 0x00 0x76 0x69  &
    
    JOY2KEY_PID=$!
    fbi ./Game\ Manuals/Atari\ 2600/Adventure/*.* -a --noverbose
    kill -INT "$JOY2KEY_PID"
    

    Everything works except for arrows keys in gamepad (it works properly for keyboard!). When I use this script with "nano" instead of "fbi", arrow keys in joy2key work properly, but on "fbi" arrows on gamepad (to scroll image) crashes this application. Any ideas why? This problem is only on "fbi". Any other app works with joy2key arrows binding.

    1 Reply Last reply Reply Quote 3
    • C
      col
      last edited by 29 Jul 2017, 10:46

      And a little explanation for anybody that was wondering about keys mapping:

      ORDER:
      
      /opt/retropie/supplementary/runcommand/joy2key.py /dev/input/js0 left right up down A B ? X Y ? L1 R1 L2 R2 select start ? lAnalog rAnalog  &
      
      ------------------------------------------------------------------
      
      CONFIG FOR "FBI" application
      
      left = keyboard left (scroll image) / kcub1 / NOT WORKING ON FBI
      right = keyboard right (scroll image) / kcuf1 / NOT WORKING ON FBI
      up = keyboard up (scroll image) / kcuu1 / NOT WORKING ON FBI
      down = keyobard down (scroll image) / kcud1 / NOT WORKING ON FBI
      
      A = + (Zoom In) / 0x2b
      B = - (Zoom Out) / 0x2d
      X = a (Auto Zoom) 0x61
      Y = p (pause slideshow) 0x70
      
      L1 = k (previous) / 0x6b
      R1 = j (next) / 0x6a
      L2 = r (rotate clockwise) 0x72
      R2 = l (rotate counter clockwise) 0x6C
      
      select = q (quit) / 0x71
      start =  h (help) 0x68
      
      lAnalog = v (toggle statusline) 0x76
      rAnalog = i (show EXIF info) 0x69
      
      Order:
      /opt/retropie/supplementary/runcommand/joy2key.py /dev/input/js0 kcub1 kcuf1 kcuu1 kcud1 0x2b 0x2d 0x00 0x61 0x70 0x00 0x6b 0x6a 0x72 0x6C 0x71 0x68 0x00 0x76 0x69  &
      
      ------------------------------------------------------------------
      
      ka1 - keypad up-left
      ka3 - keypad up-right
      kb2 - keypad center
      kbs - keypad backspace
      kbeg - begin
      kcbt - back tab
      kc1 - keypad left-down
      kc3 - keypad right-down
      kdch1 - delete
      kcud1 - down
      kend - end
      kent - enter
      kf0 - kf63 - function keys
      khome - KHome
      kich1 - insert
      kcub1 - left
      knp - next page (page down)
      kpp - previous page (page up)
      kcuf1 - right
      kDC - shift delete
      kEND - shift end
      kHOM - shift home
      kIC - shift insert
      kLFT - shift left
      kRIT - shift right
      kcuu1 - up
      
      ------------------------------------------------------------------
      
      ascii table
      
      Char  Dec  Oct  Hex | Char  Dec  Oct  Hex | Char  Dec  Oct  Hex | Char Dec  Oct   Hex
      -------------------------------------------------------------------------------------
      (nul)   0 0000 0x00 | (sp)   32 0040 0x20 | @      64 0100 0x40 | `      96 0140 0x60
      (soh)   1 0001 0x01 | !      33 0041 0x21 | A      65 0101 0x41 | a      97 0141 0x61
      (stx)   2 0002 0x02 | "      34 0042 0x22 | B      66 0102 0x42 | b      98 0142 0x62
      (etx)   3 0003 0x03 | #      35 0043 0x23 | C      67 0103 0x43 | c      99 0143 0x63
      (eot)   4 0004 0x04 | $      36 0044 0x24 | D      68 0104 0x44 | d     100 0144 0x64
      (enq)   5 0005 0x05 | %      37 0045 0x25 | E      69 0105 0x45 | e     101 0145 0x65
      (ack)   6 0006 0x06 | &      38 0046 0x26 | F      70 0106 0x46 | f     102 0146 0x66
      (bel)   7 0007 0x07 | '      39 0047 0x27 | G      71 0107 0x47 | g     103 0147 0x67
      (bs)    8 0010 0x08 | (      40 0050 0x28 | H      72 0110 0x48 | h     104 0150 0x68
      (ht)    9 0011 0x09 | )      41 0051 0x29 | I      73 0111 0x49 | i     105 0151 0x69
      (nl)   10 0012 0x0a | *      42 0052 0x2a | J      74 0112 0x4a | j     106 0152 0x6a
      (vt)   11 0013 0x0b | +      43 0053 0x2b | K      75 0113 0x4b | k     107 0153 0x6b
      (np)   12 0014 0x0c | ,      44 0054 0x2c | L      76 0114 0x4c | l     108 0154 0x6c
      (cr)   13 0015 0x0d | -      45 0055 0x2d | M      77 0115 0x4d | m     109 0155 0x6d
      (so)   14 0016 0x0e | .      46 0056 0x2e | N      78 0116 0x4e | n     110 0156 0x6e
      (si)   15 0017 0x0f | /      47 0057 0x2f | O      79 0117 0x4f | o     111 0157 0x6f
      (dle)  16 0020 0x10 | 0      48 0060 0x30 | P      80 0120 0x50 | p     112 0160 0x70
      (dc1)  17 0021 0x11 | 1      49 0061 0x31 | Q      81 0121 0x51 | q     113 0161 0x71
      (dc2)  18 0022 0x12 | 2      50 0062 0x32 | R      82 0122 0x52 | r     114 0162 0x72
      (dc3)  19 0023 0x13 | 3      51 0063 0x33 | S      83 0123 0x53 | s     115 0163 0x73
      (dc4)  20 0024 0x14 | 4      52 0064 0x34 | T      84 0124 0x54 | t     116 0164 0x74
      (nak)  21 0025 0x15 | 5      53 0065 0x35 | U      85 0125 0x55 | u     117 0165 0x75
      (syn)  22 0026 0x16 | 6      54 0066 0x36 | V      86 0126 0x56 | v     118 0166 0x76
      (etb)  23 0027 0x17 | 7      55 0067 0x37 | W      87 0127 0x57 | w     119 0167 0x77
      (can)  24 0030 0x18 | 8      56 0070 0x38 | X      88 0130 0x58 | x     120 0170 0x78
      (em)   25 0031 0x19 | 9      57 0071 0x39 | Y      89 0131 0x59 | y     121 0171 0x79
      (sub)  26 0032 0x1a | :      58 0072 0x3a | Z      90 0132 0x5a | z     122 0172 0x7a
      (esc)  27 0033 0x1b | ;      59 0073 0x3b | [      91 0133 0x5b | {     123 0173 0x7b
      (fs)   28 0034 0x1c | <      60 0074 0x3c | \      92 0134 0x5c | |     124 0174 0x7c
      (gs)   29 0035 0x1d | =      61 0075 0x3d | ]      93 0135 0x5d | }     125 0175 0x7d
      (rs)   30 0036 0x1e | >      62 0076 0x3e | ^      94 0136 0x5e | ~     126 0176 0x7e
      (us)   31 0037 0x1f | ?      63 0077 0x3f | _      95 0137 0x5f | (del) 127 0177 0x7f
      
      
      
      Non-Printable Characters
      DEC	HEX	CHARACTER (CODE)					DEC	HEX	CHARACTER (CODE)
      0	0	NULL								16	10	DATA LINK ESCAPE (DLE)
      1	1	START OF HEADING (SOH)				17	11	DEVICE CONTROL 1 (DC1)
      2	2	START OF TEXT (STX)					18	12	DEVICE CONTROL 2 (DC2)
      3	3	END OF TEXT (ETX)					19	13	DEVICE CONTROL 3 (DC3)
      4	4	END OF TRANSMISSION (EOT)			20	14	DEVICE CONTROL 4 (DC4)
      5	5	END OF QUERY (ENQ)					21	15	NEGATIVE ACKNOWLEDGEMENT (NAK)
      6	6	ACKNOWLEDGE (ACK)					22	16	SYNCHRONIZE (SYN)
      7	7	BEEP (BEL)							23	17	END OF TRANSMISSION BLOCK (ETB)
      8	8	BACKSPACE (BS)						24	18	CANCEL (CAN)
      9	9	HORIZONTAL TAB (HT)					25	19	END OF MEDIUM (EM)
      10	A	LINE FEED (LF)						26	1A	SUBSTITUTE (SUB)
      11	B	VERTICAL TAB (VT)					27	1B	ESCAPE (ESC)
      12	C	FF (FORM FEED)						28	1C	FILE SEPARATOR (FS) RIGHT ARROW
      13 	D	CR (CARRIAGE RETURN)				29	1D	GROUP SEPARATOR (GS) LEFT ARROW
      14	E	SO (SHIFT OUT)						30	1E	RECORD SEPARATOR (RS) UP ARROW
      15	F	SI (SHIFT IN)						31	1F	UNIT SEPARATOR (US) DOWN ARROW
      
      1 Reply Last reply Reply Quote 0
      • C
        col
        last edited by 29 Jul 2017, 10:58

        Also: I wanted to do the edit of the first post to include everything in one post and correct details of the post but I cannot, due to a:
        "Post content was flagged as spam by Akismet.com"

        1 Reply Last reply Reply Quote 0
        • R
          r3fear
          last edited by 22 Aug 2018, 21:54

          Great job!

          Today I will test your script, it's just what I needed!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

            This community forum collects and processes your personal information.
            consent.not_received