OSDN Git Service

TextInputを追加
authormaruhiro <maruhiro@bridge.ocn.ne.jp>
Sat, 22 Nov 2014 06:18:14 +0000 (15:18 +0900)
committermaruhiro <maruhiro@bridge.ocn.ne.jp>
Sat, 22 Nov 2014 06:18:14 +0000 (15:18 +0900)
TextInput.html [new file with mode: 0644]
TextInput1.png [new file with mode: 0644]
TextInput2.png [new file with mode: 0644]
TextInput3.png [new file with mode: 0644]
TextInput4.png [new file with mode: 0644]
TextInput5.png [new file with mode: 0644]

diff --git a/TextInput.html b/TextInput.html
new file mode 100644 (file)
index 0000000..b36a52c
--- /dev/null
@@ -0,0 +1,136 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="ja-JP">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<meta name="keywords" content="Simple Directmedia Layer SDL 2.0">
+<link rel="top" href="index.html" title="\83z\81[\83\80">
+<link rel="parent" href="FAQs.html" title="1\82Â\8fã">
+<title>TextInput</title>
+</head>
+<body>
+<a href="index.html">\96Ú\8e\9f</a> - \83`\83\85\81[\83g\83\8a\83A\83\8b - TextInput
+<hr>
+<h1>TextInput</h1>
+<h2>\82È\82º?</h2>
+<p>
+\82È\82ºSDL\82É\82Í\83e\83L\83X\83g\93ü\97ÍAPI\82ª\95K\97v\82È\82Ì\82©?
+</p>
+<p>
+\83L\81[\83{\81[\83h\82Ì\83L\81[\82ð\89\9f\82¹\82Î, \83v\83\8d\83O\83\89\83\80\82Í\95\8e\9a\83C\83x\83\93\83g\82ð\8eó\90M\82·\82é. \82»\82¤\82Å\82Í\82È\82¢\82Ì\82©?
+</p>
+<p>
+\8fí\82É\82»\82Ì\82æ\82¤\82É\92P\8f\83\82È\82í\82¯\82Å\82Í\82È\82¢.
+1\82Â\82Ì\95\8e\9a\82Ì\82½\82ß\82É\95¡\90\94\82Ì\83L\81[\82ª\95K\97v\82È\82±\82Æ\82ª\82 \82è, 1\82Â\82Ì\83L\81[\82ª\95¡\90\94\82Ì\95\8e\9a\82ð\90\90¬\82·\82é\82±\82Æ\82à\82 \82é.
+</p>
+<p>
+\83e\83L\83X\83g\93ü\97Í\82Í, \90¢\8aE\92\86\82Ì\83\86\81[\83U\82ð\8dl\97\82·\82é\82È\82ç\82Î(\82»\82µ\82Ä\82»\82¤\82·\82×\82«\82¾), \8c©\82½\96Ú\82Ù\82Ç\92P\8f\83\82Å\82Í\82È\82¢.
+\92\86\8d\91\8cê, \93ú\96{\8cê, \8aØ\8d\91\8cê\82È\82Ç\82ð\8c©\82ê\82Î\82·\82®\82É\82í\82©\82é\82¾\82ë\82¤.
+\82±\82ê\82ç\82ÌCJK\82Æ\8cÄ\82Î\82ê\82é\8c¾\8cê\82É\82Í\90\94\90ç\82Ì\95\8e\9a\82ª\82 \82é.
+</p>
+<p>
+\88ê\96\9c\82ð\92´\82¦\82é\83L\81[\82Ì\82 \82é\83L\81[\83{\81[\83h\82Í\91\8dÝ\82µ\93¾\82È\82¢.
+\82»\82Ì\89ð\8c\88\96@\82ª\83\\83t\83g\83E\83F\83\83C\83\93\83v\83b\83\83\81\83\\83b\83h\82Å\82 \82é.
+</p>
+<h2>\97p\8cê</h2>
+<ul>
+<li>IME - \83C\83\93\83v\83b\83\83\81\83\\83b\83\83G\83f\83B\83^. \83\\83t\83g\83E\83F\83\83C\83\93\83v\83b\83\83\81\83\\83b\83h. \83L\81[\93ü\97Í\82É\8a\84\82è\8d\9e\82Ý, (\8dÅ\8fI\93I\82É)\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82É\8fo\97Í\82·\82é\91O\82É\8f\88\97\9d\82·\82é\82½\82ß\82É\92Ê\8fí\97p\82¢\82ç\82ê\82é\83v\83\8d\83O\83\89\83\80.
+<li>\96¢\95Ï\8a·\83e\83L\83X\83g - \83\86\81[\83U\82ª\8c»\8dÝ\93ü\97Í\82µ\82Ä\82¢\82é\83e\83L\83X\83g. \83e\83L\83X\83g\82Í\82Ü\82¾\93ü\97Í\82ð\8fI\82¦\82Ä\82È\82­(\96¢\8am\92è), IME\82ª\82»\82ê\82ð\95Ò\8fW\82µ\82Ä\82¢\82é. \8aµ\97á\93I\82É\82Í, \82±\82Ì\83e\83L\83X\83g\82Í\94w\8ci\82ª\93h\82è\82Â\82Ô\82³\82ê\82Ä\82¢\82é\82©, \89º\82É\94j\90ü\82ª\88ø\82©\82ê\82Ä\82¢\82é.
+<li>\95Ï\8a· - \96¢\95Ï\8a·\83e\83L\83X\83g\82Ì\92u\82«\8a·\82¦
+<li>\95Ï\8a·\8có\95â\83\8a\83X\83g - \82 \82¢\82Ü\82¢\90«\82ª\82 \82é\8fê\8d\87\82É\97p\82¢\82ç\82ê\82é\95Ï\8a·\8có\95â\82Ì\88ê\97\97.
+</ul>
+<h2>\8eè\8f\87</h2>
+<table border="1">
+<tr><th>\8f\87\8f\98</th><th>\90à\96¾</th><th>\97á</th></tr><tr>
+<td>1</td><td>\83\86\81[\83U\82Í\83C\83\93\83v\83b\83g\83\81\83\\83b\83h(IME)\82ð\97L\8cø\82É\82·\82é. \92Ê\8fí\82Í\83z\83b\83g\83L\81[\82Ü\82½\82ÍGUI\82Å\83C\83\93\83v\83b\83g\83\81\83\\83b\83h\82ð\91I\91ð\82·\82é.</td><td><img src="TextInput1.png" alt="step1"></td></tr>
+<td>2</td><td>\83\86\81[\83U\82Í\91I\91ð\82µ\82½\8c¾\8cê\82Å\93ü\97Í\82ð\8aJ\8en\82·\82é.</td><td><img src="TextInput2.png" alt="step2"></td></tr>
+<td>3</td><td>\83\86\81[\83U\82Í\96]\82Þ\82Æ\82±\82ë\82Ü\82Å\93ü\97Í\82ð\91±\82¯\82é.</td><td><img src="TextInput3.png" alt="step3"></td></tr>
+<td>4</td><td>\83\86\81[\83U\82Í\95Ï\8a·\8có\95â\83\8a\83X\83g\82ð\8aJ\82«, \95Ï\8a·\83e\83L\83X\83g\82ð\91I\91ð\82·\82é. IME\82ª\8e©\93®\93I\82É\95Ï\8a·\83\8a\83X\83g\82ð\8aJ\82­\82æ\82¤\82É\82·\82é\82±\82Æ\82à\82Å\82«\82é.</td><td><img src="TextInput4.png" alt="step4"></td></tr>
+<td>5</td><td>\83\86\81[\83U\82Í\95Ï\8a·\82ð\8am\92è\82·\82é. IME\82Í\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82É\83e\83L\83X\83g\82ð\93n\82·.</td><td><img src="TextInput5.png" alt="step5"></td></tr>
+</table>
+<p>
+\91S\82Ä\82Ì\8aÂ\8b«\82Å\93¯\82\82Å\82 \82é\82í\82¯\82Å\82Í\82È\82¢\82ª, \8aT\97v\82Æ\82µ\82Ä\82Í\82±\82ê\82Å\8f\\95ª\82Å\82 \82é.
+</p>
+<p>
+\95¡\90\94\82Ì\83X\83^\83C\83\8b\82Ì\83C\83\93\83v\83b\83g\83\81\83\\83b\83h\82É\82Â\82¢\82Ä\82Í<a href="http://www-archive.mozilla.org/projects/intl/input-method-spec.html">\82±\82±</a>\82Å\93Ç\82ß\82é.
+SDL\82Í"on-the-spot"\83\82\81[\83h\82É\91Î\89\9e\82µ\82Ä\82¢\82é.
+\82±\82ê\82Í\8eÀ\91\95\82Ì\82Æ\82«\8fd\97v\82Å\82 \82é: \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í\96¢\95Ï\8a·\83e\83L\83X\83g\82ð\95\\8e¦\82·\82é\95K\97v\82ª\82 \82é.
+</p>
+<h2>SDL</h2>
+<p>
+SDL\82Å\82Í\82Ç\82Ì\82æ\82¤\82É\82µ\82Ä\83e\83L\83X\83g\93ü\97Í\82ð\88µ\82¦\82Î\82æ\82¢\82©?
+</p>
+<p>
+\82Ü\82¸\82Í\97á\82ð\8e¦\82·:
+</p>
+<h3>\97á</h3>
+<code>
+<pre>
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{
+    InitVideo();
+    /* ... */
+
+    SDL_StartTextInput();
+    while (!done)
+    {
+        if (SDL_PollEvent(&event))
+        {
+            switch (event.type)
+            {
+                case SDL_TEXTINPUT:
+                    /* \83e\83L\83X\83g\82Ì\96\96\94ö\82É\90V\82µ\82¢\83e\83L\83X\83g\82ð\92Ç\89Á\82·\82é */
+                    strcat(text, event.text.text);
+                    break;
+                case SDL_TEXTEDITING:
+                    /*
+                    \96¢\95Ï\8a·\83e\83L\83X\83g\82ð\8dX\90V\82·\82é.
+                    \83J\81[\83\\83\8b\88Ê\92u\82ð\8dX\90V\82·\82é.
+                    \91I\91ð\82Ì\92·\82³\82ð\95Ï\8a·\82·\82é(\95K\97v\82È\82ç\82Î).
+                    */
+                    composition = event.edit.text;
+                    cursor = event.edit.start;
+                    selection_len = event.edit.length;
+                    break;
+            }
+        }
+        Redraw();
+    }
+
+    SDL_Quit();
+
+    return 0;
+}
+</pre>
+</code>
+<h3>\8aÖ\90\94</h3>
+<ul>
+<li><a href="SDL_StartTextInput.html">SDL_StartTextInput</a>
+<li><a href="SDL_StopTextInput.html">SDL_StopTextInput</a>
+<li><a href="SDL_SetTextInputRect.html">SDL_SetTextInputRect</a>
+</ul>
+<h3>\83C\83x\83\93\83g</h3>
+<ul>
+<li><a href="SDL_TextEditingEvent.html">SDL_TextEditingEvent</a>
+<li><a href="SDL_TextInputEvent.html">SDL_TextInputEvent</a>
+</ul>
+<p>
+\92\8d\88Ó\82·\82×\82«\8fd\97v\82È\93_\82Í, \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í<a href="SDL_StartTextInput.html">SDL_StartTextInput</a>\82Æ<a href="SDL_StopTextInput.html">SDL_StopTextInput</a>\82Å\83e\83L\83X\83g\93ü\97Í\82Ì\89Â\95s\89Â\82ð\8e©\97R\82É\90Ý\92è\82Å\82«\82é\82±\82Æ\82Å\82 \82é.
+\82à\82µ\91Î\89\9e\82µ\82Ä\82¢\82ê\82Î, <a href="SDL_SetTextInputRect.html">SDL_SetTextInputRect</a>\82Í\95Ï\8a·\8có\95â\83\8a\83X\83g\82ð\82Ç\82±\82É\8aJ\82­\82©\82ð\8c\88\82ß\82é.
+</p>
+<p>
+\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í, \96¢\95Ï\8a·\83e\83L\83X\83g\82ª\95Ï\8dX\82³\82ê\82½(\82Ü\82½\82Í\8aJ\8en\82µ\82½)\82È\82ç\82Î, <a href="SDL_TextEditingEvent.html">SDL_TextEditingEvent</a>\83C\83x\83\93\83g\82ð\8eó\90M\82·\82é.
+\82±\82Ì\83C\83x\83\93\83g\82É\82Í, \96¢\95Ï\8a·\83e\83L\83X\83g\82Æ, \96¢\95Ï\8a·\83e\83L\83X\83g\93à\82Ì\83J\81[\83\\83\8b\82Ì\88Ê\92u\82ª\8aÜ\82Ü\82ê\82Ä\82¢\82é.
+\82à\82µ\91Î\89\9e\82µ\82Ä\82¢\82ê\82Î, \91I\91ð\82³\82ê\82½\83e\83L\83X\83g\82Ì\92·\82³\82à\8aÜ\82Ü\82ê\82Ä\82¢\82é.
+</p>
+<p>
+\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í, \95Ï\8a·\82ª\8am\92è\82µ(IME\82Å\82Í\82È\82¢)\92Ê\8fí\82Ì\83e\83L\83X\83g\93ü\97Í\82É\96ß\82Á\82½\82Æ\82«<a href="SDL_TextInputEvent.html">SDL_TextInputEvent</a>\83C\83x\83\93\83g\82ð\8eó\90M\82·\82é.
+\82±\82Ì\83C\83x\83\93\83g\82Ì\8eó\90M\82Í, \95Ï\8a·\82Ì\8am\92è, \82Ü\82½\82Í\96¢\95Ï\8a·\83e\83L\83X\83g\82Ì\93ü\97Í\82ª\8en\82Ü\82Á\82Ä\82¢\82È\82¢(\92¼\90Ú\93ü\97Í)\82±\82Æ\82ð\8e¦\82µ\82Ä\82¢\82é.
+</p>
+<h2>SDL Wiki\82Ö\82Ì\83\8a\83\93\83N</h2>
+<a href="https://wiki.libsdl.org/Tutorials/TextInput">Text Input - SDL Wiki</a>
+<hr>
+</body>
+</html>
diff --git a/TextInput1.png b/TextInput1.png
new file mode 100644 (file)
index 0000000..96ada7a
Binary files /dev/null and b/TextInput1.png differ
diff --git a/TextInput2.png b/TextInput2.png
new file mode 100644 (file)
index 0000000..2499c4f
Binary files /dev/null and b/TextInput2.png differ
diff --git a/TextInput3.png b/TextInput3.png
new file mode 100644 (file)
index 0000000..c5f45a2
Binary files /dev/null and b/TextInput3.png differ
diff --git a/TextInput4.png b/TextInput4.png
new file mode 100644 (file)
index 0000000..cbfd070
Binary files /dev/null and b/TextInput4.png differ
diff --git a/TextInput5.png b/TextInput5.png
new file mode 100644 (file)
index 0000000..3e1265a
Binary files /dev/null and b/TextInput5.png differ