curses-extension 1.1.0 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/curses-template.rb +14 -7
  3. metadata +9 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2491e7b9c8860078fcf3f353bdada531985f9a28308d661d6f7e752a9a283b2
4
- data.tar.gz: 91e2e96db7fcda0247d02c09a33f2ca2fe28765bb0c9cf418c44bd98a5b7097b
3
+ metadata.gz: 20ace1645f195ea2d92bbf0cb9b84955194bfc10d1eaee5f9d535a0dd8c18668
4
+ data.tar.gz: 9b2b5cc6e581753260fd16c9a474f0bdf19fc108a050d1e64671212009eb42f4
5
5
  SHA512:
6
- metadata.gz: 69aa81c3236cf57c80adc460fdc51d5b12b13685b8c702584e94f937e42552e6390b65bf3f6b4a46e6ce92cf51e7f8b7dd5367f5fb83448dc6b52c8892f1bc18
7
- data.tar.gz: d405e32770f13d430e5c710240111affc6666916f2bc60505c9856f4c1a816a8fe5bdb43ee5bd1656969fc9c940398d3ffac92b7bde098d3d5c3215774cba848
6
+ metadata.gz: 49d8d315491a99d4c3cb343d10d2d0c8f1bdce3d988458e9fdea17a38b213822accc77e49ac5f517c329a987131e13fc8cb761d12f64259f7bed05e683a7dd6a
7
+ data.tar.gz: 2a1de1c02140013d55fd8ae130ab55267ba80a5ba3374727aac41ad1d9652031a1a853127a5d67fdea1799287237457b55217cac3891df3861747e67fe2d4aed
@@ -120,7 +120,7 @@ class Curses::Window # CLASS EXTENSION
120
120
  end
121
121
 
122
122
  def getchr # PROCESS KEY PRESSES
123
- c = STDIN.getch(min: 0, time: 3)
123
+ c = STDIN.getch(min: 0, time: 1)
124
124
  case c
125
125
  when "\e" # ANSI escape sequences
126
126
  case $stdin.getc
@@ -131,12 +131,19 @@ def getchr # PROCESS KEY PRESSES
131
131
  when 'C' then chr = "RIGHT"
132
132
  when 'D' then chr = "LEFT"
133
133
  when 'Z' then chr = "S-TAB"
134
- when '2' then chr = "INS" ; STDIN.getc
135
- when '3' then chr = "DEL" ; STDIN.getc
136
- when '5' then chr = "PgUP" ; STDIN.getc
137
- when '6' then chr = "PgDOWN" ; STDIN.getc
138
- when '7' then chr = "HOME" ; STDIN.getc
139
- when '8' then chr = "END" ; STDIN.getc
134
+ when '2' then chr = "INS" ; chr = "C-INS" if STDIN.getc == "^"
135
+ when '3' then chr = "DEL" ; chr = "C-DEL" if STDIN.getc == "^"
136
+ when '5' then chr = "PgUP" ; chr = "C-PgUP" if STDIN.getc == "^"
137
+ when '6' then chr = "PgDOWN" ; chr = "C-PgDOWN" if STDIN.getc == "^"
138
+ when '7' then chr = "HOME" ; chr = "C-HOME" if STDIN.getc == "^"
139
+ when '8' then chr = "END" ; chr = "C-END" if STDIN.getc == "^"
140
+ end
141
+ when 'O'
142
+ case $stdin.getc
143
+ when 'a' then chr = "C-UP"
144
+ when 'b' then chr = "C-DOWN"
145
+ when 'c' then chr = "C-RIGHT"
146
+ when 'd' then chr = "C-LEFT"
140
147
  end
141
148
  end
142
149
  when "", "" then chr = "BACK"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curses-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-25 00:00:00.000000000 Z
11
+ date: 2021-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -30,26 +30,13 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.3.2
33
- description: "The attributes and functions included in this gem:\n\n Attribute |
34
- Description\n ----------|--------------------------------------------------------\n
35
- \ color | Set the windows color to an already initiated color pair with init_pair(index,
36
- forground, backround)\n fg | Foreground color for window (0-255)\n bg |
37
- Background color for window (0-255)\n attr | Attributes for window (such as
38
- Curses::A_BOLD) - string with \"\\|\" (such as Curses::A_BOLD \\| Curses::A_UNDERLINE)\n
39
- \ update | Whether to update the window on the next refresh\n \n Function |
40
- Description\n --------------------|--------------------------------------------------------\n
41
- \ clr | Clears window without flicker (win.clear flickers)\n clr_to_cur_pos
42
- \ | Clears the window up to the current line\n clr_from_cur_pos | Clears
43
- the rest of the window after the current line\n fill | Fill window
44
- with color as set by :color ( or :bg if not :color is set)\n fill_to_cur_pos |
45
- Fill the window up to the current line\n fill_from_cur_pos | Fill the rest of
46
- the window after the current line\n p(text) | Write text to window
47
- with color or fg/bg and attributes (will handle the exceptions if no colors are
48
- set)\n pclr(text) | As `p(text)` but also clears the rest of the window\n
49
- \ pa(fg,bg,attr,text) | Write text to window with specified fg, bg and attribute(s)\n
50
- \ paclr(text) | As pa(text) but also clears the rest of the window\n \n
51
- \ The curses_template.rb includes the class extension and serves as the basis for
52
- my curses applications."
33
+ description: 'The Ruby curses library is sorely lacking some important features. This
34
+ class extension adds a set of features that makes it much easier to create and manage
35
+ terminal curses applications in Ruby. See the Github page for information on what
36
+ properties and functions are included: https://github.com/isene/Ruby-Curses-Class-Extension.
37
+ The curses_template.rb is also installed in the lib directory and serves as the
38
+ basis for my own curses applications. New in 1.1.4: In the template, also catch
39
+ Control+Key sequence'
53
40
  email: g@isene.com
54
41
  executables: []
55
42
  extensions: []